Add helpers to BaseConfig to be able to use useEnglish in compose

This commit is contained in:
Ensar Sarajčić 2023-10-09 12:59:49 +02:00
parent 31af0c48e0
commit eecd4af5cc

View file

@ -218,10 +218,14 @@ open class BaseConfig(val context: Context) {
prefs.edit().putBoolean(USE_ENGLISH, useEnglish).commit()
}
val useEnglishFlow = ::useEnglish.asFlowNonNull()
var wasUseEnglishToggled: Boolean
get() = prefs.getBoolean(WAS_USE_ENGLISH_TOGGLED, false)
set(wasUseEnglishToggled) = prefs.edit().putBoolean(WAS_USE_ENGLISH_TOGGLED, wasUseEnglishToggled).apply()
val wasUseEnglishToggledFlow = ::wasUseEnglishToggled.asFlowNonNull()
var wasSharedThemeEverActivated: Boolean
get() = prefs.getBoolean(WAS_SHARED_THEME_EVER_ACTIVATED, false)
set(wasSharedThemeEverActivated) = prefs.edit().putBoolean(WAS_SHARED_THEME_EVER_ACTIVATED, wasSharedThemeEverActivated).apply()