File tree Expand file tree Collapse file tree
app/src/main/java/io/github/sds100/keymapper/data/repositories Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package io.github.sds100.keymapper.data.repositories
22
33import android.content.Context
4- import androidx.datastore.preferences.SharedPreferencesMigration
54import androidx.datastore.preferences.core.Preferences
65import androidx.datastore.preferences.core.edit
76import androidx.datastore.preferences.preferencesDataStore
8- import io.github.sds100.keymapper.Constants
97import kotlinx.coroutines.CoroutineScope
108import kotlinx.coroutines.flow.Flow
119import kotlinx.coroutines.flow.distinctUntilChanged
@@ -17,21 +15,9 @@ class SettingsPreferenceRepository(
1715 private val coroutineScope : CoroutineScope ,
1816) : PreferenceRepository {
1917
20- companion object {
21- private const val DEFAULT_SHARED_PREFS_NAME = " ${Constants .PACKAGE_NAME } _preferences"
22- }
23-
2418 private val ctx = context.applicationContext
2519
26- private val sharedPreferencesMigration = SharedPreferencesMigration (
27- ctx,
28- DEFAULT_SHARED_PREFS_NAME ,
29- )
30-
31- private val Context .dataStore by preferencesDataStore(
32- name = " preferences" ,
33- produceMigrations = { listOf (sharedPreferencesMigration) },
34- )
20+ private val Context .dataStore by preferencesDataStore(name = " preferences" )
3521
3622 private val dataStore = ctx.dataStore
3723
You can’t perform that action at this time.
0 commit comments