mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-07-03 14:06:34 +02:00
@@ -85,6 +85,7 @@ fun EditTextPreference(
|
||||
title: String,
|
||||
value: Int,
|
||||
enabled: Boolean,
|
||||
isError: Boolean = false,
|
||||
keyboardActions: KeyboardActions,
|
||||
onValueChanged: (Int) -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
@@ -97,7 +98,7 @@ fun EditTextPreference(
|
||||
title = title,
|
||||
value = valueState,
|
||||
enabled = enabled,
|
||||
isError = value.toUInt().toString() != valueState,
|
||||
isError = value.toUInt().toString() != valueState || isError,
|
||||
keyboardOptions = KeyboardOptions.Default.copy(
|
||||
keyboardType = KeyboardType.Number, imeAction = ImeAction.Done
|
||||
),
|
||||
|
||||
+11
-1
@@ -233,6 +233,13 @@ fun MQTTConfigItemList(
|
||||
mapReportSettings = settings
|
||||
}
|
||||
},
|
||||
publishIntervalSecs = mqttInput.mapReportSettings.publishIntervalSecs,
|
||||
onPublishIntervalSecsChanged = {
|
||||
val settings = mqttInput.mapReportSettings.copy { publishIntervalSecs = it }
|
||||
mqttInput = mqttInput.copy {
|
||||
mapReportSettings = settings
|
||||
}
|
||||
},
|
||||
enabled = enabled,
|
||||
focusManager = focusManager
|
||||
)
|
||||
@@ -241,7 +248,8 @@ fun MQTTConfigItemList(
|
||||
|
||||
item {
|
||||
val consentValid = if (mqttInput.mapReportingEnabled) {
|
||||
mqttInput.mapReportSettings.shouldReportLocation
|
||||
mqttInput.mapReportSettings.shouldReportLocation &&
|
||||
mqttConfig.mapReportSettings.publishIntervalSecs >= MinIntervalSecs
|
||||
} else {
|
||||
true
|
||||
}
|
||||
@@ -260,6 +268,8 @@ fun MQTTConfigItemList(
|
||||
}
|
||||
}
|
||||
|
||||
private const val MinIntervalSecs = 3600
|
||||
|
||||
@Preview(showBackground = true)
|
||||
@Composable
|
||||
private fun MQTTConfigPreview() {
|
||||
|
||||
+1
@@ -138,6 +138,7 @@ fun MapReportingPreference(
|
||||
modifier = Modifier.Companion.padding(bottom = 16.dp),
|
||||
title = stringResource(R.string.map_reporting_interval_seconds),
|
||||
value = publishIntervalSecs,
|
||||
isError = publishIntervalSecs < 3600,
|
||||
enabled = enabled,
|
||||
keyboardActions = KeyboardActions(onDone = { focusManager.clearFocus() }),
|
||||
onValueChanged = onPublishIntervalSecsChanged,
|
||||
|
||||
Reference in New Issue
Block a user