Make AndroidPreferenceStore use Settings backend

This commit is contained in:
tarsin committed 2023-06-05 12:09:36 +08:00
1 parent b3acd1d603
commit 8c6d28d6e2
2 files changed
+4 -7

No files matched your search

@@ -166,7 +166,7 @@ class EhApplication : Application(), ImageLoaderFactory {
}
}
val readerPreferences by lazy { ReaderPreferences(AndroidPreferenceStore(appCtx)) }
val readerPreferences by lazy { ReaderPreferences(AndroidPreferenceStore) }
val ehDatabase by lazy { roomDb<EhDatabase>("eh.db") { allowMainThreadQueries() } }
@@ -1,8 +1,7 @@
package eu.kanade.tachiyomi.core.preference
import android.content.Context
import android.content.SharedPreferences
import androidx.preference.PreferenceManager
import com.hippo.ehviewer.Settings
import eu.kanade.tachiyomi.core.preference.AndroidPreference.BooleanPrimitive
import eu.kanade.tachiyomi.core.preference.AndroidPreference.FloatPrimitive
import eu.kanade.tachiyomi.core.preference.AndroidPreference.IntPrimitive
@@ -13,11 +12,9 @@ import eu.kanade.tachiyomi.core.preference.AndroidPreference.StringSetPrimitive
import kotlinx.coroutines.channels.awaitClose
import kotlinx.coroutines.flow.callbackFlow
class AndroidPreferenceStore(
context: Context,
) : PreferenceStore {
object AndroidPreferenceStore : PreferenceStore {
private val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context)
private val sharedPreferences = Settings.prefs
private val keyFlow = sharedPreferences.keyFlow