region setting from android now kinda works

This commit is contained in:
Kevin Hester 2021-03-04 10:25:24 +08:00
parent 81e76bfc51
commit bd1885aaf2
3 changed files with 76 additions and 37 deletions

View file

@ -124,12 +124,7 @@ class UIViewModel(private val app: Application) : AndroidViewModel(app), Logging
}
var lsSleepSecs: Int?
get() {
radioConfig.value?.preferences?.let {
return it.lsSecs
}
return null
}
get() = radioConfig.value?.preferences?.lsSecs
set(value) {
val config = radioConfig.value
if (value != null && config != null) {
@ -139,6 +134,17 @@ class UIViewModel(private val app: Application) : AndroidViewModel(app), Logging
}
}
var region: RadioConfigProtos.RegionCode?
get() = radioConfig.value?.preferences?.region
set(value) {
val config = radioConfig.value
if (value != null && config != null) {
val builder = config.toBuilder()
builder.preferencesBuilder.region = value
setRadioConfig(builder.build())
}
}
/// hardware info about our local device (can be null)
val myNodeInfo = object : MutableLiveData<MyNodeInfo?>(null) {}