File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
app/src/main/java/com/threegap/bitnagil Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import androidx.compose.foundation.layout.fillMaxSize
1111import androidx.compose.foundation.layout.padding
1212import androidx.compose.material3.Scaffold
1313import androidx.compose.runtime.Composable
14+ import androidx.compose.runtime.LaunchedEffect
1415import androidx.compose.runtime.SideEffect
1516import androidx.compose.runtime.getValue
1617import androidx.compose.runtime.mutableLongStateOf
@@ -56,7 +57,7 @@ fun HomeNavHost(
5657
5758 val activity = LocalActivity .current
5859 val isHomeTab = navigator.isHomeRoute
59- SideEffect {
60+ LaunchedEffect (isHomeTab) {
6061 activity?.setStatusBarContentColor(isLightContent = isHomeTab)
6162 }
6263
Original file line number Diff line number Diff line change @@ -5,8 +5,11 @@ import androidx.core.view.WindowCompat
55
66fun Activity.setStatusBarContentColor (isLightContent : Boolean ) {
77 val window = this .window
8- val view = window.decorView
9- val wic = WindowCompat .getInsetsController(window, view)
8+ val wic = WindowCompat .getInsetsController(window, window.decorView)
109
11- wic.isAppearanceLightStatusBars = ! isLightContent
10+ val targetAppearance = ! isLightContent
11+
12+ if (wic.isAppearanceLightStatusBars != targetAppearance) {
13+ wic.isAppearanceLightStatusBars = targetAppearance
14+ }
1215}
You can’t perform that action at this time.
0 commit comments