mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
This commit is contained in:
parent
4a46908ddd
commit
12d96b76db
2 changed files with 6 additions and 4 deletions
|
|
@ -72,7 +72,7 @@ fun MQTTConfigScreen(viewModel: RadioConfigViewModel = hiltViewModel(), onBack:
|
||||||
val consentValid =
|
val consentValid =
|
||||||
if (formState.value.mapReportingEnabled) {
|
if (formState.value.mapReportingEnabled) {
|
||||||
formState.value.mapReportSettings.shouldReportLocation &&
|
formState.value.mapReportSettings.shouldReportLocation &&
|
||||||
mqttConfig.mapReportSettings.publishIntervalSecs >= MIN_INTERVAL_SECS
|
formState.value.mapReportSettings.publishIntervalSecs >= MIN_INTERVAL_SECS
|
||||||
} else {
|
} else {
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ import org.meshtastic.core.strings.map_reporting_summary
|
||||||
import org.meshtastic.core.ui.component.DropDownPreference
|
import org.meshtastic.core.ui.component.DropDownPreference
|
||||||
import org.meshtastic.core.ui.component.SwitchPreference
|
import org.meshtastic.core.ui.component.SwitchPreference
|
||||||
import org.meshtastic.core.ui.component.precisionBitsToMeters
|
import org.meshtastic.core.ui.component.precisionBitsToMeters
|
||||||
|
import org.meshtastic.feature.settings.util.FixedUpdateIntervals
|
||||||
import org.meshtastic.feature.settings.util.IntervalConfiguration
|
import org.meshtastic.feature.settings.util.IntervalConfiguration
|
||||||
import org.meshtastic.feature.settings.util.toDisplayString
|
import org.meshtastic.feature.settings.util.toDisplayString
|
||||||
import kotlin.math.roundToInt
|
import kotlin.math.roundToInt
|
||||||
|
|
@ -131,10 +132,11 @@ fun MapReportingPreference(
|
||||||
DropDownPreference(
|
DropDownPreference(
|
||||||
modifier = Modifier.padding(bottom = 16.dp),
|
modifier = Modifier.padding(bottom = 16.dp),
|
||||||
title = stringResource(Res.string.map_reporting_interval_seconds),
|
title = stringResource(Res.string.map_reporting_interval_seconds),
|
||||||
items = publishItems.map { it.value to it.toDisplayString() },
|
items = publishItems.map { it to it.toDisplayString() },
|
||||||
selectedItem = publishIntervalSecs,
|
selectedItem =
|
||||||
|
FixedUpdateIntervals.fromValue(publishIntervalSecs.toLong()) ?: publishItems.first(),
|
||||||
enabled = enabled,
|
enabled = enabled,
|
||||||
onItemSelected = { onPublishIntervalSecsChanged(it.toInt()) },
|
onItemSelected = { onPublishIntervalSecsChanged(it.value.toInt()) },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue