mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-20 18:48:16 -04:00
Implemented Safe Call on Night Mode Toggle
This commit is contained in:
parent
e2bc5b8352
commit
fca830027c
@ -127,7 +127,8 @@ class SharedPreferenceUtil @Inject constructor(context: Context?) {
|
||||
|
||||
val nightMode: NightModeConfig.Mode
|
||||
get() = from(
|
||||
sharedPreferences.getString("", null)?.toInt() ?: AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
|
||||
sharedPreferences.getString(PREF_NIGHT_MODE, null)?.toInt()
|
||||
?: AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
|
||||
)
|
||||
|
||||
fun nightModes(): Flowable<NightModeConfig.Mode> = nightModes.startWith(nightMode)
|
||||
|
Loading…
x
Reference in New Issue
Block a user