mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
fix/2542 pair up the power metric icons (#2572)
This commit is contained in:
parent
e66f6c3433
commit
00898d64be
1 changed files with 13 additions and 2 deletions
|
|
@ -993,6 +993,13 @@ private fun EnvironmentMetrics(
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays environmental metrics for a node, including temperature, humidity, pressure, and other sensor data.
|
||||
*
|
||||
* WARNING: All metrics must be added in pairs (e.g., voltage and current for each channel) due to the display logic,
|
||||
* which arranges metrics in columns of two. If an odd number of metrics is provided, the UI may not display as
|
||||
* intended.
|
||||
*/
|
||||
@Composable
|
||||
private fun PowerMetrics(node: Node) {
|
||||
val metrics =
|
||||
|
|
@ -1019,8 +1026,12 @@ private fun PowerMetrics(node: Node) {
|
|||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
verticalArrangement = Arrangement.SpaceEvenly,
|
||||
) {
|
||||
metrics.forEach { metric ->
|
||||
InfoCard(icon = metric.icon, text = stringResource(metric.label), value = metric.value)
|
||||
metrics.chunked(2).forEach { rowMetrics ->
|
||||
Column {
|
||||
rowMetrics.forEach { metric ->
|
||||
InfoCard(icon = metric.icon, text = stringResource(metric.label), value = metric.value)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue