mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-10-10 07:03:35 +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
|
val view = LocalView.current
|
||||||
if (!view.isInEditMode && darkTheme) {
|
if (!view.isInEditMode) {
|
||||||
SideEffect {
|
SideEffect {
|
||||||
val window = (view.context as Activity).window
|
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