From a8e8fe01b711d6be94c8a644bd159c0aff51ec1d Mon Sep 17 00:00:00 2001 From: Ahmad Ansori Palembani Date: Mon, 12 Aug 2024 08:10:32 +0700 Subject: [PATCH] fix(theme): Status bar stays on dark mode when app is following system theme Fixes GH-146 --- CHANGELOG.md | 2 ++ .../main/java/eu/kanade/tachiyomi/util/system/ThemeUtil.kt | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2951d4f5c2..05c70ef7ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,8 @@ - Fixed crashes when trying to reload extension repo due to connection issue - Fixed tap controls not working properly after zoom - Fixed (sorta, more like workaround) ANR issues when running background tasks, such as updating extensions +- Fixed split (downloaded) tall images sometimes doesn't work +- Fixed status bar stuck in dark mode when app is following system theme ## Translation - Update Japanese translation (akir45) diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/system/ThemeUtil.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/ThemeUtil.kt index 0461704d1d..83ce972fe8 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/system/ThemeUtil.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/ThemeUtil.kt @@ -69,8 +69,8 @@ object ThemeUtil { fun AppCompatActivity.setThemeByPref(preferences: PreferencesHelper) { setTheme(getPrefTheme(preferences).styleRes) val wic = WindowInsetsControllerCompat(window, window.decorView) - wic.isAppearanceLightStatusBars = preferences.nightMode().get() == AppCompatDelegate.MODE_NIGHT_NO - wic.isAppearanceLightNavigationBars = preferences.nightMode().get() == AppCompatDelegate.MODE_NIGHT_NO + wic.isAppearanceLightStatusBars = !isDarkMode(preferences) + wic.isAppearanceLightNavigationBars = !isDarkMode(preferences) } fun AppCompatActivity.getThemeWithExtras(theme: Resources.Theme, preferences: PreferencesHelper, oldTheme: Resources.Theme?): Resources.Theme {