mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
feat(firmware): add firmware edition handling (#2508)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
parent
45ad973d35
commit
924bd25f60
6 changed files with 598 additions and 557 deletions
|
|
@ -255,13 +255,16 @@ private fun handleNodeAction(
|
|||
val channel = if (hasPKC) DataPacket.PKC_CHANNEL_INDEX else node.channel
|
||||
navigateToMessages("$channel${node.user.id}")
|
||||
}
|
||||
|
||||
is NodeMenuAction.Remove -> {
|
||||
uiViewModel.handleNodeMenuAction(menuAction)
|
||||
onNavigateUp()
|
||||
}
|
||||
|
||||
else -> uiViewModel.handleNodeMenuAction(menuAction)
|
||||
}
|
||||
}
|
||||
|
||||
is NodeDetailAction.ShareContact -> {
|
||||
/* Handled in NodeDetailContent */
|
||||
}
|
||||
|
|
@ -438,11 +441,19 @@ private fun AdministrationSection(
|
|||
}
|
||||
}
|
||||
|
||||
node.metadata?.firmwareVersion?.let { firmwareVersion ->
|
||||
val latestStable = metricsState.latestStableFirmware
|
||||
val latestAlpha = metricsState.latestAlphaFirmware
|
||||
PreferenceCategory(stringResource(R.string.firmware)) {
|
||||
val firmwareEdition = metricsState.firmwareEdition
|
||||
firmwareEdition?.let {
|
||||
NodeDetailRow(
|
||||
label = stringResource(R.string.firmware_edition),
|
||||
icon = Icons.Default.Download,
|
||||
value = it.name,
|
||||
)
|
||||
}
|
||||
node.metadata?.firmwareVersion?.let { firmwareVersion ->
|
||||
val latestStable = metricsState.latestStableFirmware
|
||||
val latestAlpha = metricsState.latestAlphaFirmware
|
||||
|
||||
PreferenceCategory(stringResource(R.string.firmware)) {
|
||||
val deviceVersion = DeviceVersion(firmwareVersion.substringBeforeLast("."))
|
||||
val statusColor = deviceVersion.determineFirmwareStatusColor(latestStable, latestAlpha)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue