Don't invalidate theme if it hasn't changed
Change-Id: I0811218679409ac7e111aa7609736fc19de5236b
This commit is contained in:
parent
5e721d55f9
commit
1231e6b0aa
|
@ -91,9 +91,13 @@ object ThemeUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun invalidateNightMode(context: Context) {
|
fun invalidateNightMode(context: Context) {
|
||||||
|
val lightTheme = getApplicationLightTheme(context)
|
||||||
|
val darkTheme = getApplicationDarkTheme(context)
|
||||||
|
if (lightTheme != darkTheme && darkThemePossible(context)) {
|
||||||
mThemeInitialized = false;
|
mThemeInitialized = false;
|
||||||
setApplicationTheme(context.applicationContext, getApplicationLightTheme(context), getApplicationDarkTheme(context))
|
setApplicationTheme(context.applicationContext, getApplicationLightTheme(context), getApplicationDarkTheme(context))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// init the theme
|
// init the theme
|
||||||
fun init(context: Context) {
|
fun init(context: Context) {
|
||||||
|
|
Loading…
Reference in New Issue