Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
005df7db19 | ||
|
|
0a92dce8a9 | ||
|
|
cd705961ca |
No files matched your search
+1
-1
@@ -88,7 +88,7 @@ The first release of Clockula: alarms, timers, a stopwatch and a world clock.
|
||||
- Settings: theme, dynamic colour, language, and the defaults every new alarm
|
||||
and timer inherits.
|
||||
- A Black theme next to Light and Dark: dark with pure black backgrounds,
|
||||
for AMOLED screens.
|
||||
navigation bar included, for AMOLED screens.
|
||||
- Choose how long a ringing alarm or a finished timer keeps going before it
|
||||
stops on its own: 1, 5, 10, 15, 20 or 25 minutes, or Never, separately for
|
||||
alarms and timers. Ten minutes stays the default, and Never still stops
|
||||
|
||||
@@ -32,8 +32,8 @@ android {
|
||||
// versionCode is derived from versionName by scripts/version_info.sh
|
||||
// (1.0.0-beta.1 -> 1000001, 1.0.0 -> 1000099), and CI fails if the
|
||||
// committed one doesn't match. See docs/RELEASING.md.
|
||||
versionCode = 1000006
|
||||
versionName = "1.0.0-beta.6"
|
||||
versionCode = 1000007
|
||||
versionName = "1.0.0-beta.7"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
@@ -101,15 +101,17 @@ class MainActivity : ComponentActivity() {
|
||||
// flag: with the device dark and ThemeMode.LIGHT stored, deriving the
|
||||
// icon colours from the system would paint white icons onto a light
|
||||
// background. Re-applied whenever the stored preference changes.
|
||||
LaunchedEffect(darkTheme) { applyEdgeToEdge(darkTheme) }
|
||||
val pureBlack = darkTheme && appearance.themeMode.isPureBlack
|
||||
LaunchedEffect(darkTheme, pureBlack) { applyEdgeToEdge(darkTheme, pureBlack) }
|
||||
|
||||
ClockulaTheme(
|
||||
darkTheme = darkTheme,
|
||||
dynamicColor = appearance.dynamicColor,
|
||||
pureBlack = appearance.themeMode.isPureBlack,
|
||||
pureBlack = pureBlack,
|
||||
) {
|
||||
ClockulaShell(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
pureBlack = pureBlack,
|
||||
openRequest = openRequest,
|
||||
// Consumed once: a request left standing would re-select the
|
||||
// tab on every recomposition and fight the user's taps.
|
||||
@@ -136,10 +138,11 @@ class MainActivity : ComponentActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun applyEdgeToEdge(darkTheme: Boolean) {
|
||||
private fun applyEdgeToEdge(darkTheme: Boolean, pureBlack: Boolean) {
|
||||
val darkScrim = if (pureBlack) NAV_BAR_BLACK_SCRIM else NAV_BAR_DARK_SCRIM
|
||||
enableEdgeToEdge(
|
||||
statusBarStyle = SystemBarStyle.auto(Color.TRANSPARENT, Color.TRANSPARENT) { darkTheme },
|
||||
navigationBarStyle = SystemBarStyle.auto(NAV_BAR_LIGHT_SCRIM, NAV_BAR_DARK_SCRIM) { darkTheme },
|
||||
navigationBarStyle = SystemBarStyle.auto(NAV_BAR_LIGHT_SCRIM, darkScrim) { darkTheme },
|
||||
)
|
||||
}
|
||||
|
||||
@@ -187,3 +190,6 @@ class MainActivity : ComponentActivity() {
|
||||
/** The scrims androidx uses for a three-button navigation bar, matched exactly. */
|
||||
private val NAV_BAR_LIGHT_SCRIM = Color.argb(0xe6, 0xFF, 0xFF, 0xFF)
|
||||
private val NAV_BAR_DARK_SCRIM = Color.argb(0x80, 0x1b, 0x1b, 0x1b)
|
||||
|
||||
/** The Black theme's: the dark one's alpha over black, so the bar reads black (#28). */
|
||||
private val NAV_BAR_BLACK_SCRIM = Color.argb(0x80, 0x00, 0x00, 0x00)
|
||||
@@ -12,8 +12,10 @@ import androidx.compose.foundation.pager.HorizontalPager
|
||||
import androidx.compose.foundation.pager.PagerState
|
||||
import androidx.compose.foundation.pager.rememberPagerState
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.adaptive.currentWindowAdaptiveInfo
|
||||
import androidx.compose.material3.adaptive.navigationsuite.NavigationSuiteDefaults
|
||||
import androidx.compose.material3.adaptive.navigationsuite.NavigationSuiteItem
|
||||
import androidx.compose.material3.adaptive.navigationsuite.NavigationSuiteScaffold
|
||||
import androidx.compose.material3.adaptive.navigationsuite.NavigationSuiteScaffoldDefaults
|
||||
@@ -77,10 +79,15 @@ import kotlin.math.sign
|
||||
* state is saveable, so the tab survives rotation and process death with no
|
||||
* mirror of ours to drift — and the `NavHost` holds only what is pushed over
|
||||
* the tabs: the editors, the timer setup page, Settings.
|
||||
*
|
||||
* With [pureBlack] the bar sits on the black ground rather than on
|
||||
* `surfaceContainer`, so the bottom of the screen is black down to the
|
||||
* system navigation bar (#28).
|
||||
*/
|
||||
@Composable
|
||||
fun ClockulaShell(
|
||||
modifier: Modifier = Modifier,
|
||||
pureBlack: Boolean = false,
|
||||
openRequest: ShellRequest? = null,
|
||||
onRequestConsumed: () -> Unit = {},
|
||||
viewModel: ShellViewModel = hiltViewModel(),
|
||||
@@ -192,6 +199,14 @@ fun ClockulaShell(
|
||||
enabled = back is ShellBackAction.GoTo,
|
||||
),
|
||||
navigationSuiteType = navigationSuiteType,
|
||||
navigationSuiteColors = if (pureBlack) {
|
||||
NavigationSuiteDefaults.colors(
|
||||
shortNavigationBarContainerColor = MaterialTheme.colorScheme.background,
|
||||
navigationBarContainerColor = MaterialTheme.colorScheme.background,
|
||||
)
|
||||
} else {
|
||||
NavigationSuiteDefaults.colors()
|
||||
},
|
||||
) {
|
||||
Box(Modifier.fillMaxSize()) {
|
||||
CompositionLocalProvider(
|
||||
|
||||
Reference in new issue
Block a user