remove MyPreferences

This commit is contained in:
andrekir
2022-06-22 22:07:55 -03:00
parent ab020713bd
commit 6211015495
2 changed files with 2 additions and 7 deletions

View File

@@ -1,5 +0,0 @@
package com.geeksville.mesh.model
object MyPreferences {
val provideLocationKey = "provide-location"
}

View File

@@ -284,12 +284,12 @@ class UIViewModel @Inject constructor(
private val _ownerName = MutableLiveData<String?>()
val ownerName: LiveData<String?> get() = _ownerName
val provideLocation = object : MutableLiveData<Boolean>(preferences.getBoolean(MyPreferences.provideLocationKey, false)) {
val provideLocation = object : MutableLiveData<Boolean>(preferences.getBoolean("provide-location", false)) {
override fun setValue(value: Boolean) {
super.setValue(value)
preferences.edit {
this.putBoolean(MyPreferences.provideLocationKey, value)
this.putBoolean("provide-location", value)
}
}
}