mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
store background location pref
This commit is contained in:
parent
74f7281a60
commit
74a34cd9b6
5 changed files with 20 additions and 2 deletions
|
|
@ -0,0 +1,5 @@
|
|||
package com.geeksville.mesh.model
|
||||
|
||||
object MyPreferences {
|
||||
val provideLocationKey = "provide-location"
|
||||
}
|
||||
|
|
@ -190,6 +190,15 @@ class UIViewModel(private val app: Application) : AndroidViewModel(app), Logging
|
|||
val bluetoothEnabled = object : MutableLiveData<Boolean>(false) {
|
||||
}
|
||||
|
||||
val provideLocation = object : MutableLiveData<Boolean>(getPreferences(context).getBoolean(MyPreferences.provideLocationKey, false)) {
|
||||
override fun setValue(value: Boolean) {
|
||||
super.setValue(value)
|
||||
|
||||
getPreferences(context).edit(commit = true) {
|
||||
this.putBoolean(MyPreferences.provideLocationKey, value)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// If the app was launched because we received a new channel intent, the Url will be here
|
||||
var requestedChannelUrl: Uri? = null
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue