mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
feat: show LoRa configs based on usePreset
This commit is contained in:
parent
054d2330a4
commit
d8faece43f
1 changed files with 33 additions and 31 deletions
|
|
@ -682,39 +682,41 @@ fun DeviceSettingsItemList(viewModel: UIViewModel) {
|
||||||
}
|
}
|
||||||
item { Divider() }
|
item { Divider() }
|
||||||
|
|
||||||
item {
|
if (loraInput.usePreset) {
|
||||||
DropDownPreference(title = "Modem preset",
|
item {
|
||||||
enabled = connected && loraInput.usePreset,
|
DropDownPreference(title = "Modem preset",
|
||||||
items = ConfigProtos.Config.LoRaConfig.ModemPreset.values()
|
enabled = connected && loraInput.usePreset,
|
||||||
.filter { it != ConfigProtos.Config.LoRaConfig.ModemPreset.UNRECOGNIZED }
|
items = ConfigProtos.Config.LoRaConfig.ModemPreset.values()
|
||||||
.map { it to it.name },
|
.filter { it != ConfigProtos.Config.LoRaConfig.ModemPreset.UNRECOGNIZED }
|
||||||
selectedItem = loraInput.modemPreset,
|
.map { it to it.name },
|
||||||
onItemSelected = { loraInput = loraInput.copy { modemPreset = it } })
|
selectedItem = loraInput.modemPreset,
|
||||||
}
|
onItemSelected = { loraInput = loraInput.copy { modemPreset = it } })
|
||||||
item { Divider() }
|
}
|
||||||
|
item { Divider() }
|
||||||
|
} else {
|
||||||
|
item {
|
||||||
|
EditTextPreference(title = "Bandwidth",
|
||||||
|
value = loraInput.bandwidth,
|
||||||
|
enabled = connected && !loraInput.usePreset,
|
||||||
|
keyboardActions = KeyboardActions(onDone = { focusManager.clearFocus() }),
|
||||||
|
onValueChanged = { loraInput = loraInput.copy { bandwidth = it } })
|
||||||
|
}
|
||||||
|
|
||||||
item {
|
item {
|
||||||
EditTextPreference(title = "Bandwidth",
|
EditTextPreference(title = "Spread factor",
|
||||||
value = loraInput.bandwidth,
|
value = loraInput.spreadFactor,
|
||||||
enabled = connected && !loraInput.usePreset,
|
enabled = connected && !loraInput.usePreset,
|
||||||
keyboardActions = KeyboardActions(onDone = { focusManager.clearFocus() }),
|
keyboardActions = KeyboardActions(onDone = { focusManager.clearFocus() }),
|
||||||
onValueChanged = { loraInput = loraInput.copy { bandwidth = it } })
|
onValueChanged = { loraInput = loraInput.copy { spreadFactor = it } })
|
||||||
}
|
}
|
||||||
|
|
||||||
item {
|
item {
|
||||||
EditTextPreference(title = "Spread factor",
|
EditTextPreference(title = "Coding rate",
|
||||||
value = loraInput.spreadFactor,
|
value = loraInput.codingRate,
|
||||||
enabled = connected && !loraInput.usePreset,
|
enabled = connected && !loraInput.usePreset,
|
||||||
keyboardActions = KeyboardActions(onDone = { focusManager.clearFocus() }),
|
keyboardActions = KeyboardActions(onDone = { focusManager.clearFocus() }),
|
||||||
onValueChanged = { loraInput = loraInput.copy { spreadFactor = it } })
|
onValueChanged = { loraInput = loraInput.copy { codingRate = it } })
|
||||||
}
|
}
|
||||||
|
|
||||||
item {
|
|
||||||
EditTextPreference(title = "Coding rate",
|
|
||||||
value = loraInput.codingRate,
|
|
||||||
enabled = connected && !loraInput.usePreset,
|
|
||||||
keyboardActions = KeyboardActions(onDone = { focusManager.clearFocus() }),
|
|
||||||
onValueChanged = { loraInput = loraInput.copy { codingRate = it } })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
item {
|
item {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue