mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-01-31 03:17:13 +01:00
Correctly update full application theme on night mode change
This commit is contained in:
parent
0ba49f5596
commit
6b1c75dae4
@ -37,11 +37,10 @@ class VectorConfiguration @Inject constructor(private val context: Context) {
|
|||||||
Timber.v("## onConfigurationChanged(): the locale has been updated to ${Locale.getDefault()}")
|
Timber.v("## onConfigurationChanged(): the locale has been updated to ${Locale.getDefault()}")
|
||||||
Timber.v("## onConfigurationChanged(): restore the expected value ${VectorLocale.applicationLocale}")
|
Timber.v("## onConfigurationChanged(): restore the expected value ${VectorLocale.applicationLocale}")
|
||||||
Locale.setDefault(VectorLocale.applicationLocale)
|
Locale.setDefault(VectorLocale.applicationLocale)
|
||||||
ThemeUtils.invalidateNightMode()
|
|
||||||
}
|
}
|
||||||
if (ThemeUtils.useDarkTheme(context) != ThemeUtils.shouldUseDarkTheme(context)) {
|
if (ThemeUtils.useDarkTheme(context) != ThemeUtils.shouldUseDarkTheme(context)) {
|
||||||
Timber.v("## onConfigurationChanged(): night mode has changed")
|
Timber.v("## onConfigurationChanged(): night mode has changed")
|
||||||
ThemeUtils.invalidateNightMode()
|
ThemeUtils.invalidateNightMode(context)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,8 +68,9 @@ object ThemeUtils {
|
|||||||
return mUseDarkTheme
|
return mUseDarkTheme
|
||||||
}
|
}
|
||||||
|
|
||||||
fun invalidateNightMode() {
|
fun invalidateNightMode(context: Context) {
|
||||||
mThemeInitialized = false;
|
mThemeInitialized = false;
|
||||||
|
setApplicationTheme(context.applicationContext, getApplicationLightTheme(context), getApplicationDarkTheme(context))
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user