From 3b1581a2ba5a9bdf8c416ccc8875c739aa2d6d84 Mon Sep 17 00:00:00 2001 From: Jonathan Klee Date: Fri, 20 Sep 2024 14:57:10 +0200 Subject: [PATCH] Set status bar theme programatically --- .../main/java/io/heckel/ntfy/ui/MainSettingsActivity.kt | 8 ++++++++ app/src/main/res/values/styles.xml | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/heckel/ntfy/ui/MainSettingsActivity.kt b/app/src/main/java/io/heckel/ntfy/ui/MainSettingsActivity.kt index 07e9767..1aabb1a 100644 --- a/app/src/main/java/io/heckel/ntfy/ui/MainSettingsActivity.kt +++ b/app/src/main/java/io/heckel/ntfy/ui/MainSettingsActivity.kt @@ -37,11 +37,19 @@ class MainSettingsActivity : AppCompatActivity() { val isLightMode = isSystemInLightMode() if (isLightMode) { + insetsController.setSystemBarsAppearance( + WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS, + WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS + ) insetsController.setSystemBarsAppearance( WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS, WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS ) } else { + insetsController.setSystemBarsAppearance( + 0, + WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS + ) insetsController.setSystemBarsAppearance( 0, WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 3238e49..e724494 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -49,7 +49,6 @@ @color/e_divider_color @android:color/transparent @color/e_background - ?attr/isLightTheme @style/ETheme.Switch