Improve wear os overview screen

This commit is contained in:
darken
2022-09-14 18:00:18 +02:00
committed by Matthias Urhahn
parent 1d51c207f4
commit bf4ad7886c
18 changed files with 332 additions and 539 deletions
@@ -65,7 +65,7 @@ class OverviewFragmentVM @Inject constructor(
}
val shouldStartMonitor = when (generalSettings.monitorMode.value) {
MonitorMode.MANUAL -> false
MonitorMode.PERIODICALLY, MonitorMode.MANUAL -> false
MonitorMode.AUTOMATIC -> bluetoothManager.connectedDevices().first().isNotEmpty()
MonitorMode.ALWAYS -> true
}
@@ -127,7 +127,7 @@ class MonitorWorker @AssistedInject constructor(
.flatMapLatest { (monitorMode, devices) ->
log(TAG) { "Monitor mode: $monitorMode" }
when (monitorMode) {
MonitorMode.MANUAL -> flow<Unit> {
MonitorMode.PERIODICALLY, MonitorMode.MANUAL -> flow<Unit> {
// Cancel worker, ui scans manually
workerScope.coroutineContext.cancelChildren()
}