From 38bb9f457d528b9d3c65d5dd267361e47bc462d3 Mon Sep 17 00:00:00 2001 From: greenart7c3 <115044884+greenart7c3@users.noreply.github.com> Date: Fri, 7 Jul 2023 06:09:18 -0300 Subject: [PATCH] fix statusbar color when changing theme --- .../java/com/vitorpamplona/amethyst/ui/theme/Theme.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/theme/Theme.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/theme/Theme.kt index 88cf6fec2..a1966e8a6 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/theme/Theme.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/theme/Theme.kt @@ -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() + } } } }