mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
Issue #369 - Use repository pattern for bluetooth state
(cherry picked from commit b3878a4240)
This commit is contained in:
parent
1294eee8e3
commit
c0fe9213f1
11 changed files with 224 additions and 109 deletions
|
|
@ -74,10 +74,6 @@ class UIViewModel @Inject constructor(
|
|||
debug("ViewModel created")
|
||||
}
|
||||
|
||||
fun insertPacket(packet: Packet) = viewModelScope.launch(Dispatchers.IO) {
|
||||
repository.insert(packet)
|
||||
}
|
||||
|
||||
fun deleteAllPacket() = viewModelScope.launch(Dispatchers.IO) {
|
||||
repository.deleteAll()
|
||||
}
|
||||
|
|
@ -229,10 +225,6 @@ class UIViewModel @Inject constructor(
|
|||
val ownerName = object : MutableLiveData<String>("MrIDE Test") {
|
||||
}
|
||||
|
||||
|
||||
val bluetoothEnabled = object : MutableLiveData<Boolean>(false) {
|
||||
}
|
||||
|
||||
val provideLocation = object : MutableLiveData<Boolean>(preferences.getBoolean(MyPreferences.provideLocationKey, false)) {
|
||||
override fun setValue(value: Boolean) {
|
||||
super.setValue(value)
|
||||
|
|
@ -243,9 +235,6 @@ class UIViewModel @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
/// If the app was launched because we received a new channel intent, the Url will be here
|
||||
var requestedChannelUrl: Uri? = null
|
||||
|
||||
// clean up all this nasty owner state management FIXME
|
||||
fun setOwner(s: String? = null) {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue