From d15bf23eeec13f166263ba28318fde43ce682484 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Tue, 8 Feb 2022 02:01:26 +0530 Subject: [PATCH] android: use the correct nav color and make the check fancier --- .../kotlin/dev/msfjarvis/claw/android/ui/LobstersApp.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/LobstersApp.kt b/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/LobstersApp.kt index 89bdf865..6ce39607 100644 --- a/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/LobstersApp.kt +++ b/android/src/main/kotlin/dev/msfjarvis/claw/android/ui/LobstersApp.kt @@ -14,7 +14,6 @@ import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.platform.LocalContext @@ -75,6 +74,7 @@ fun LobstersApp( ProvideWindowInsets { val currentUiMode = LocalConfiguration.current.uiMode val systemBarsColor = MaterialTheme.colorScheme.surfaceColorAtNavigationBarElevation() + val backgroundColor = MaterialTheme.colorScheme.background val navItems = listOf( NavigationItem( @@ -94,8 +94,8 @@ fun LobstersApp( // Track UI mode as a key to force a navbar color update when dark theme is toggled LaunchedEffect(currentDestination, currentUiMode) { val color = - if (currentDestination !in navItems.map { it.route }) { - Color.Transparent + if (navItems.none { item -> item.route == currentDestination }) { + backgroundColor } else { systemBarsColor }