From 789fd835d0c6aa6ac944cb667b849bedc39a1d15 Mon Sep 17 00:00:00 2001 From: s-ayush2903 Date: Tue, 18 Aug 2020 15:59:33 +0530 Subject: [PATCH] Getter and backing for textZoom --- .../kiwix/kiwixmobile/core/utils/SharedPreferenceUtil.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/utils/SharedPreferenceUtil.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/SharedPreferenceUtil.kt index 727dc370e..4736860b9 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/core/utils/SharedPreferenceUtil.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/SharedPreferenceUtil.kt @@ -42,7 +42,9 @@ class SharedPreferenceUtil @Inject constructor(val context: Context) { private val _prefStorages = PublishProcessor.create() val prefStorages get() = _prefStorages.startWith { prefStorage } - private val textZooms = PublishProcessor.create() + private val _textZooms = PublishProcessor.create() + val textZooms + get() = _textZooms.startWith { textZoom } private val nightModes = PublishProcessor.create() 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 = textZooms.startWith(textZoom) - companion object { // Prefs const val PREF_LANG = "pref_language_chooser"