Merge pull request #1880 from esensar/enable-use-english-for-compose
Add helpers to `BaseConfig` to be able to use `useEnglish` in compose
This commit is contained in:
commit
9e60e24790
1 changed files with 4 additions and 0 deletions
|
@ -218,10 +218,14 @@ open class BaseConfig(val context: Context) {
|
||||||
prefs.edit().putBoolean(USE_ENGLISH, useEnglish).commit()
|
prefs.edit().putBoolean(USE_ENGLISH, useEnglish).commit()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val useEnglishFlow = ::useEnglish.asFlowNonNull()
|
||||||
|
|
||||||
var wasUseEnglishToggled: Boolean
|
var wasUseEnglishToggled: Boolean
|
||||||
get() = prefs.getBoolean(WAS_USE_ENGLISH_TOGGLED, false)
|
get() = prefs.getBoolean(WAS_USE_ENGLISH_TOGGLED, false)
|
||||||
set(wasUseEnglishToggled) = prefs.edit().putBoolean(WAS_USE_ENGLISH_TOGGLED, wasUseEnglishToggled).apply()
|
set(wasUseEnglishToggled) = prefs.edit().putBoolean(WAS_USE_ENGLISH_TOGGLED, wasUseEnglishToggled).apply()
|
||||||
|
|
||||||
|
val wasUseEnglishToggledFlow = ::wasUseEnglishToggled.asFlowNonNull()
|
||||||
|
|
||||||
var wasSharedThemeEverActivated: Boolean
|
var wasSharedThemeEverActivated: Boolean
|
||||||
get() = prefs.getBoolean(WAS_SHARED_THEME_EVER_ACTIVATED, false)
|
get() = prefs.getBoolean(WAS_SHARED_THEME_EVER_ACTIVATED, false)
|
||||||
set(wasSharedThemeEverActivated) = prefs.edit().putBoolean(WAS_SHARED_THEME_EVER_ACTIVATED, wasSharedThemeEverActivated).apply()
|
set(wasSharedThemeEverActivated) = prefs.edit().putBoolean(WAS_SHARED_THEME_EVER_ACTIVATED, wasSharedThemeEverActivated).apply()
|
||||||
|
|
Loading…
Reference in a new issue