fix(theme): Status bar stays on dark mode when app is following system theme

Fixes GH-146
This commit is contained in:
Ahmad Ansori Palembani 2024-08-12 08:10:32 +07:00
parent 0bdecfe60f
commit a8e8fe01b7
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
2 changed files with 4 additions and 2 deletions

View file

@ -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)

View file

@ -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 {