From f822080d0c62034b345ff3dc3d212c241dd47718 Mon Sep 17 00:00:00 2001 From: andrekir Date: Sun, 19 May 2024 06:47:48 -0300 Subject: [PATCH] refactor: hide GPS satellites with empty values --- .../java/com/geeksville/mesh/ui/NodeInfo.kt | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/com/geeksville/mesh/ui/NodeInfo.kt b/app/src/main/java/com/geeksville/mesh/ui/NodeInfo.kt index 2f5b69b50..2ad2b742c 100644 --- a/app/src/main/java/com/geeksville/mesh/ui/NodeInfo.kt +++ b/app/src/main/java/com/geeksville/mesh/ui/NodeInfo.kt @@ -216,19 +216,22 @@ fun NodeInfo( suffix = elevationSuffix ) - SatelliteCountInfo( - modifier = Modifier.constrainAs(sats) { - top.linkTo(alt.bottom, 4.dp) - linkTo( - start = pos.start, - end = env.start, - endMargin = 8.dp, - bias = 0F, - ) - width = Dimension.preferredWrapContent - }, - satCount = position.satellitesInView - ) + val satCount = position.satellitesInView + if (satCount > 0) { + SatelliteCountInfo( + modifier = Modifier.constrainAs(sats) { + top.linkTo(alt.bottom, 4.dp) + linkTo( + start = pos.start, + end = env.start, + endMargin = 8.dp, + bias = 0F, + ) + width = Dimension.preferredWrapContent + }, + satCount = satCount + ) + } } BatteryInfo(