kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
fix: Conditionally show UDP settings (#1702)
Only show UDP settings if the device has both Ethernet and WiFi.pull/1703/head
rodzic
373cfe7838
commit
8a8ee27ad9
|
@ -277,24 +277,26 @@ fun NetworkConfigItemList(
|
|||
})
|
||||
}
|
||||
item { Divider() }
|
||||
if (hasEthernet && hasWifi) {
|
||||
item {
|
||||
PreferenceCategory(text = stringResource(R.string.udp_config))
|
||||
}
|
||||
|
||||
item {
|
||||
PreferenceCategory(text = stringResource(R.string.udp_config))
|
||||
item {
|
||||
SwitchPreference(
|
||||
title = stringResource(R.string.mesh_via_udp_enabled),
|
||||
checked = networkInput.enabledProtocols == 1,
|
||||
enabled = enabled,
|
||||
onCheckedChange = {
|
||||
networkInput =
|
||||
networkInput.copy {
|
||||
if (it) enabledProtocols = 1 else enabledProtocols = 0
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
item { Divider() }
|
||||
}
|
||||
|
||||
item {
|
||||
SwitchPreference(
|
||||
title = stringResource(R.string.mesh_via_udp_enabled),
|
||||
checked = networkInput.enabledProtocols == 1,
|
||||
enabled = enabled,
|
||||
onCheckedChange = {
|
||||
networkInput =
|
||||
networkInput.copy { if (it) enabledProtocols = 1 else enabledProtocols = 0 }
|
||||
})
|
||||
}
|
||||
|
||||
item { Divider() }
|
||||
|
||||
item {
|
||||
PreferenceFooter(
|
||||
enabled = enabled && networkInput != networkConfig,
|
||||
|
|
Ładowanie…
Reference in New Issue