mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Fix crash when set theme not in use no longer exists
This commit is contained in:
parent
490b467ed2
commit
da76d4854f
1 changed files with 1 additions and 12 deletions
|
@ -99,18 +99,7 @@ class SettingsGeneralController : SettingsController() {
|
|||
titleRes = R.string.app_theme
|
||||
lastScrollPostionLight = lastThemeXLight
|
||||
lastScrollPostionDark = lastThemeXDark
|
||||
summary = if (preferences.nightMode()
|
||||
.get() == AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
|
||||
) {
|
||||
val lightTheme = preferences.lightTheme().get().nameRes
|
||||
val darkTheme = preferences.darkTheme().get().nameRes
|
||||
val nightMode = context.isInNightMode()
|
||||
mutableListOf(context.getString(lightTheme), context.getString(darkTheme)).apply {
|
||||
if (nightMode) reverse()
|
||||
}.joinToString(" / ")
|
||||
} else {
|
||||
context.getString(context.getPrefTheme(preferences).nameRes)
|
||||
}
|
||||
summary = context.getString(context.getPrefTheme(preferences).nameRes)
|
||||
activity = this@SettingsGeneralController.activity
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue