mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2025-01-11 00:49:10 +01:00
Only use launchWhenCreated when the context isn't in nightmode already
This commit is contained in:
parent
a3f210dbf0
commit
29eec83389
@ -67,10 +67,14 @@ fun AppCompatActivity.setThemeAndNight(preferences: PreferencesHelper) {
|
|||||||
if (ThemeUtil.isColoredTheme(theme)) {
|
if (ThemeUtil.isColoredTheme(theme)) {
|
||||||
setTheme(R.style.ThemeOverlay_Tachiyomi_AllBlue)
|
setTheme(R.style.ThemeOverlay_Tachiyomi_AllBlue)
|
||||||
}
|
}
|
||||||
|
if (!isInNightMode()) {
|
||||||
|
lifecycle.coroutineScope.launchWhenCreated {
|
||||||
|
AppCompatDelegate.setDefaultNightMode(preferences.nightMode().get())
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
lifecycle.coroutineScope.launchWhenCreated {
|
AppCompatDelegate.setDefaultNightMode(preferences.nightMode().get())
|
||||||
AppCompatDelegate.setDefaultNightMode(preferences.nightMode().get())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Context.getPrefTheme(preferences: PreferencesHelper): Themes {
|
fun Context.getPrefTheme(preferences: PreferencesHelper): Themes {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user