mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-06-02 06:24:16 +02:00
fix: hide battery indicator when level is 0 (never reported) (#5595)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -254,11 +254,13 @@ private fun NodeBatteryPositionRow(
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
MaterialBatteryInfo(
|
||||
level = thatNode.batteryLevel ?: 0,
|
||||
voltage = thatNode.voltage ?: 0f,
|
||||
contentColor = contentColor,
|
||||
)
|
||||
if ((thatNode.batteryLevel ?: 0) > 0) {
|
||||
MaterialBatteryInfo(
|
||||
level = thatNode.batteryLevel ?: 0,
|
||||
voltage = thatNode.voltage ?: 0f,
|
||||
contentColor = contentColor,
|
||||
)
|
||||
}
|
||||
|
||||
Row(horizontalArrangement = Arrangement.spacedBy(8.dp), verticalAlignment = Alignment.CenterVertically) {
|
||||
if (distance != null) {
|
||||
|
||||
@@ -200,7 +200,7 @@ fun NodeItemCompact(
|
||||
verticalArrangement = Arrangement.spacedBy(4.dp),
|
||||
) {
|
||||
NodeChip(node = thatNode)
|
||||
if (showPower && thatNode.batteryLevel != null) {
|
||||
if (showPower && (thatNode.batteryLevel ?: 0) > 0) {
|
||||
MaterialBatteryInfo(
|
||||
level = thatNode.batteryLevel ?: 0,
|
||||
voltage = thatNode.voltage ?: 0f,
|
||||
|
||||
Reference in New Issue
Block a user