Getter and backing for textZoom

This commit is contained in:
s-ayush2903 2020-08-18 15:59:33 +05:30
parent ce3ba7590a
commit 789fd835d0
No known key found for this signature in database
GPG Key ID: B4341DD08B2371CB

View File

@ -42,7 +42,9 @@ class SharedPreferenceUtil @Inject constructor(val context: Context) {
private val _prefStorages = PublishProcessor.create<String>()
val prefStorages
get() = _prefStorages.startWith { prefStorage }
private val textZooms = PublishProcessor.create<Int>()
private val _textZooms = PublishProcessor.create<Int>()
val textZooms
get() = _textZooms.startWith { textZoom }
private val nightModes = PublishProcessor.create<NightModeConfig.Mode>()
val prefWifiOnly: Boolean
@ -145,11 +147,9 @@ class SharedPreferenceUtil @Inject constructor(val context: Context) {
get() = sharedPreferences.getInt(TEXT_ZOOM, DEFAULT_ZOOM)
set(textZoom) {
sharedPreferences.edit { putInt(TEXT_ZOOM, textZoom) }
textZooms.offer(textZoom)
_textZooms.offer(textZoom)
}
fun getTextZooms(): Flowable<Int> = textZooms.startWith(textZoom)
companion object {
// Prefs
const val PREF_LANG = "pref_language_chooser"