Adds hardware model string to NodeInfo card ui if available (#1111)

pull/1120/head^2
James Rich 2024-07-01 20:17:05 -05:00 zatwierdzone przez GitHub
rodzic fe651a7cb5
commit a59aaf5c28
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 28 dodań i 4 usunięć

Wyświetl plik

@ -90,7 +90,7 @@ fun NodeInfo(
.background(bgColor)
.padding(8.dp)
) {
val (chip, dist, name, pos, alt, sats, batt, heard, sig, env) = createRefs()
val (chip, dist, name, hw, pos, alt, sats, batt, heard, sig, env) = createRefs()
val barrierBattHeard = createStartBarrier(batt, heard)
val sigBarrier = createBottomBarrier(pos, heard)
@ -149,8 +149,7 @@ fun NodeInfo(
bias = 0F,
startMargin = 8.dp,
endMargin = 8.dp,
)
)
width = Dimension.preferredWrapContent
},
text = nodeName,
@ -158,11 +157,36 @@ fun NodeInfo(
textDecoration = TextDecoration.LineThrough.takeIf { isIgnored },
)
val hwInfoString = thisNodeInfo?.user?.hwModelString
if (hwInfoString != null){
Text(
modifier = Modifier.constrainAs(hw) {
linkTo(
top = name.bottom,
bottom = pos.top,
bias = 0F,
topMargin = 4.dp,
bottomMargin = 4.dp
)
linkTo(
start = name.start,
end = barrierBattHeard,
bias = 0F,
endMargin = 8.dp
)
width = Dimension.preferredWrapContent
},
text = hwInfoString,
fontSize = MaterialTheme.typography.caption.fontSize,
style = style,
)
}
val position = thatNodeInfo.position
LinkedCoordinates(
modifier = Modifier.constrainAs(pos) {
linkTo(
top = name.bottom,
top = hw.bottom,
bottom = sig.top,
bias = 0F,
topMargin = 4.dp,