mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-27 22:26:23 +02:00
fix statusbar color when changing theme
This commit is contained in:
@@ -323,10 +323,14 @@ fun AmethystTheme(themeViewModel: ThemeViewModel, content: @Composable () -> Uni
|
||||
)
|
||||
|
||||
val view = LocalView.current
|
||||
if (!view.isInEditMode && darkTheme) {
|
||||
if (!view.isInEditMode) {
|
||||
SideEffect {
|
||||
val window = (view.context as Activity).window
|
||||
window.statusBarColor = colors.background.toArgb()
|
||||
if (darkTheme) {
|
||||
window.statusBarColor = colors.background.toArgb()
|
||||
} else {
|
||||
window.statusBarColor = colors.primary.toArgb()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user