kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
update configs
rodzic
ebe6b1030e
commit
bb698e14d1
|
@ -155,6 +155,26 @@ fun DeviceSettingsItemList(viewModel: UIViewModel) {
|
||||||
}
|
}
|
||||||
item { Divider() }
|
item { Divider() }
|
||||||
|
|
||||||
|
item {
|
||||||
|
EditTextPreference(title = "Redefine PIN_BUTTON",
|
||||||
|
value = deviceInput.buttonGpio,
|
||||||
|
enabled = connected,
|
||||||
|
keyboardActions = KeyboardActions(onDone = { focusManager.clearFocus() }),
|
||||||
|
onValueChanged = {
|
||||||
|
deviceInput = deviceInput.copy { buttonGpio = it }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
item {
|
||||||
|
EditTextPreference(title = "Redefine PIN_BUZZER",
|
||||||
|
value = deviceInput.buzzerGpio,
|
||||||
|
enabled = connected,
|
||||||
|
keyboardActions = KeyboardActions(onDone = { focusManager.clearFocus() }),
|
||||||
|
onValueChanged = {
|
||||||
|
deviceInput = deviceInput.copy { buzzerGpio = it }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
item {
|
item {
|
||||||
PreferenceFooter(
|
PreferenceFooter(
|
||||||
enabled = deviceInput != localConfig.device,
|
enabled = deviceInput != localConfig.device,
|
||||||
|
@ -266,6 +286,22 @@ fun DeviceSettingsItemList(viewModel: UIViewModel) {
|
||||||
}
|
}
|
||||||
item { Divider() }
|
item { Divider() }
|
||||||
|
|
||||||
|
item {
|
||||||
|
EditTextPreference(title = "Redefine GPS_RX_PIN",
|
||||||
|
value = positionInput.rxGpio,
|
||||||
|
enabled = connected,
|
||||||
|
keyboardActions = KeyboardActions(onDone = { focusManager.clearFocus() }),
|
||||||
|
onValueChanged = { positionInput = positionInput.copy { rxGpio = it } })
|
||||||
|
}
|
||||||
|
|
||||||
|
item {
|
||||||
|
EditTextPreference(title = "Redefine GPS_TX_PIN",
|
||||||
|
value = positionInput.txGpio,
|
||||||
|
enabled = connected,
|
||||||
|
keyboardActions = KeyboardActions(onDone = { focusManager.clearFocus() }),
|
||||||
|
onValueChanged = { positionInput = positionInput.copy { txGpio = it } })
|
||||||
|
}
|
||||||
|
|
||||||
item {
|
item {
|
||||||
PreferenceFooter(
|
PreferenceFooter(
|
||||||
enabled = positionInput != localConfig.position || positionInfo != ourNodeInfo?.position,
|
enabled = positionInput != localConfig.position || positionInfo != ourNodeInfo?.position,
|
||||||
|
|
|
@ -83,7 +83,7 @@ fun ModuleSettingsItemList(viewModel: UIViewModel) {
|
||||||
),
|
),
|
||||||
keyboardActions = KeyboardActions(onDone = { focusManager.clearFocus() }),
|
keyboardActions = KeyboardActions(onDone = { focusManager.clearFocus() }),
|
||||||
onValueChanged = { value ->
|
onValueChanged = { value ->
|
||||||
if (value.toByteArray().size <= 31) // username max_size:32
|
if (value.toByteArray().size <= 63) // username max_size:64
|
||||||
mqttInput = mqttInput.copy { username = value }
|
mqttInput = mqttInput.copy { username = value }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ fun ModuleSettingsItemList(viewModel: UIViewModel) {
|
||||||
),
|
),
|
||||||
keyboardActions = KeyboardActions(onDone = { focusManager.clearFocus() }),
|
keyboardActions = KeyboardActions(onDone = { focusManager.clearFocus() }),
|
||||||
onValueChanged = { value ->
|
onValueChanged = { value ->
|
||||||
if (value.toByteArray().size <= 31) // password max_size:32
|
if (value.toByteArray().size <= 63) // password max_size:64
|
||||||
mqttInput = mqttInput.copy { password = value }
|
mqttInput = mqttInput.copy { password = value }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -186,7 +186,7 @@ fun ModuleSettingsItemList(viewModel: UIViewModel) {
|
||||||
}
|
}
|
||||||
|
|
||||||
item {
|
item {
|
||||||
DropDownPreference(title = "Serial baud rate",
|
DropDownPreference(title = "Serial mode",
|
||||||
enabled = connected,
|
enabled = connected,
|
||||||
items = ModuleConfig.SerialConfig.Serial_Mode.values()
|
items = ModuleConfig.SerialConfig.Serial_Mode.values()
|
||||||
.filter { it != ModuleConfig.SerialConfig.Serial_Mode.UNRECOGNIZED }
|
.filter { it != ModuleConfig.SerialConfig.Serial_Mode.UNRECOGNIZED }
|
||||||
|
@ -212,7 +212,7 @@ fun ModuleSettingsItemList(viewModel: UIViewModel) {
|
||||||
item { PreferenceCategory(text = "External Notification Config") }
|
item { PreferenceCategory(text = "External Notification Config") }
|
||||||
|
|
||||||
item {
|
item {
|
||||||
SwitchPreference(title = "External Notification enabled",
|
SwitchPreference(title = "External notification enabled",
|
||||||
checked = externalNotificationInput.enabled,
|
checked = externalNotificationInput.enabled,
|
||||||
enabled = connected,
|
enabled = connected,
|
||||||
onCheckedChange = {
|
onCheckedChange = {
|
||||||
|
@ -271,6 +271,16 @@ fun ModuleSettingsItemList(viewModel: UIViewModel) {
|
||||||
}
|
}
|
||||||
item { Divider() }
|
item { Divider() }
|
||||||
|
|
||||||
|
item {
|
||||||
|
SwitchPreference(title = "Use PWM buzzer",
|
||||||
|
checked = externalNotificationInput.usePwm,
|
||||||
|
enabled = connected,
|
||||||
|
onCheckedChange = {
|
||||||
|
externalNotificationInput = externalNotificationInput.copy { usePwm = it }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
item { Divider() }
|
||||||
|
|
||||||
item {
|
item {
|
||||||
PreferenceFooter(
|
PreferenceFooter(
|
||||||
enabled = externalNotificationInput != moduleConfig.externalNotification,
|
enabled = externalNotificationInput != moduleConfig.externalNotification,
|
||||||
|
@ -346,7 +356,7 @@ fun ModuleSettingsItemList(viewModel: UIViewModel) {
|
||||||
item { PreferenceCategory(text = "Range Test Config") }
|
item { PreferenceCategory(text = "Range Test Config") }
|
||||||
|
|
||||||
item {
|
item {
|
||||||
SwitchPreference(title = "Range Test enabled",
|
SwitchPreference(title = "Range test enabled",
|
||||||
checked = rangeTestInput.enabled,
|
checked = rangeTestInput.enabled,
|
||||||
enabled = connected,
|
enabled = connected,
|
||||||
onCheckedChange = { rangeTestInput = rangeTestInput.copy { enabled = it } })
|
onCheckedChange = { rangeTestInput = rangeTestInput.copy { enabled = it } })
|
||||||
|
@ -450,7 +460,17 @@ fun ModuleSettingsItemList(viewModel: UIViewModel) {
|
||||||
item { PreferenceCategory(text = "Canned Message Config") }
|
item { PreferenceCategory(text = "Canned Message Config") }
|
||||||
|
|
||||||
item {
|
item {
|
||||||
SwitchPreference(title = "Rotary encoder enabled",
|
SwitchPreference(title = "Canned message enabled",
|
||||||
|
checked = cannedMessageInput.enabled,
|
||||||
|
enabled = connected,
|
||||||
|
onCheckedChange = {
|
||||||
|
cannedMessageInput = cannedMessageInput.copy { enabled = it }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
item { Divider() }
|
||||||
|
|
||||||
|
item {
|
||||||
|
SwitchPreference(title = "Rotary encoder #1 enabled",
|
||||||
checked = cannedMessageInput.rotary1Enabled,
|
checked = cannedMessageInput.rotary1Enabled,
|
||||||
enabled = connected,
|
enabled = connected,
|
||||||
onCheckedChange = {
|
onCheckedChange = {
|
||||||
|
@ -538,6 +558,31 @@ fun ModuleSettingsItemList(viewModel: UIViewModel) {
|
||||||
}
|
}
|
||||||
item { Divider() }
|
item { Divider() }
|
||||||
|
|
||||||
|
item {
|
||||||
|
EditTextPreference(title = "Allow input source",
|
||||||
|
value = cannedMessageInput.allowInputSource,
|
||||||
|
enabled = connected,
|
||||||
|
isError = false,
|
||||||
|
keyboardOptions = KeyboardOptions.Default.copy(
|
||||||
|
keyboardType = KeyboardType.Text, imeAction = ImeAction.Done
|
||||||
|
),
|
||||||
|
keyboardActions = KeyboardActions(onDone = { focusManager.clearFocus() }),
|
||||||
|
onValueChanged = { value ->
|
||||||
|
if (value.toByteArray().size <= 15) // allow_input_source max_size:16
|
||||||
|
cannedMessageInput = cannedMessageInput.copy { allowInputSource = value }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
item {
|
||||||
|
SwitchPreference(title = "Send bell",
|
||||||
|
checked = cannedMessageInput.sendBell,
|
||||||
|
enabled = connected,
|
||||||
|
onCheckedChange = {
|
||||||
|
cannedMessageInput = cannedMessageInput.copy { sendBell = it }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
item { Divider() }
|
||||||
|
|
||||||
item {
|
item {
|
||||||
PreferenceFooter(
|
PreferenceFooter(
|
||||||
enabled = cannedMessageInput != moduleConfig.cannedMessage,
|
enabled = cannedMessageInput != moduleConfig.cannedMessage,
|
||||||
|
|
Ładowanie…
Reference in New Issue