File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
app/src/main/java/com/techlads/composetv/theme Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ import androidx.compose.ui.graphics.toArgb
1818import androidx.compose.ui.platform.LocalContext
1919import androidx.compose.ui.platform.LocalView
2020import androidx.compose.ui.unit.dp
21- import androidx.core.view.ViewCompat
21+ import androidx.core.view.WindowCompat
2222
2323private val DarkColorScheme = darkColorScheme(
2424 primary = Purple80 ,
@@ -59,8 +59,10 @@ fun Material3Theme(
5959 val view = LocalView .current
6060 if (! view.isInEditMode) {
6161 SideEffect {
62- (view.context as Activity ).window.statusBarColor = colorScheme.primary.toArgb()
63- ViewCompat .getWindowInsetsController(view)?.isAppearanceLightStatusBars = darkTheme
62+ (view.context as ? Activity )?.window?.run {
63+ statusBarColor = colorScheme.primary.toArgb()
64+ WindowCompat .getInsetsController(this , view).isAppearanceLightStatusBars = darkTheme
65+ }
6466 }
6567 }
6668
You can’t perform that action at this time.
0 commit comments