kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
Adds hardware model string to NodeInfo card ui if available (#1111)
rodzic
fe651a7cb5
commit
a59aaf5c28
|
@ -90,7 +90,7 @@ fun NodeInfo(
|
||||||
.background(bgColor)
|
.background(bgColor)
|
||||||
.padding(8.dp)
|
.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 barrierBattHeard = createStartBarrier(batt, heard)
|
||||||
val sigBarrier = createBottomBarrier(pos, heard)
|
val sigBarrier = createBottomBarrier(pos, heard)
|
||||||
|
|
||||||
|
@ -149,8 +149,7 @@ fun NodeInfo(
|
||||||
bias = 0F,
|
bias = 0F,
|
||||||
startMargin = 8.dp,
|
startMargin = 8.dp,
|
||||||
endMargin = 8.dp,
|
endMargin = 8.dp,
|
||||||
|
)
|
||||||
)
|
|
||||||
width = Dimension.preferredWrapContent
|
width = Dimension.preferredWrapContent
|
||||||
},
|
},
|
||||||
text = nodeName,
|
text = nodeName,
|
||||||
|
@ -158,11 +157,36 @@ fun NodeInfo(
|
||||||
textDecoration = TextDecoration.LineThrough.takeIf { isIgnored },
|
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
|
val position = thatNodeInfo.position
|
||||||
LinkedCoordinates(
|
LinkedCoordinates(
|
||||||
modifier = Modifier.constrainAs(pos) {
|
modifier = Modifier.constrainAs(pos) {
|
||||||
linkTo(
|
linkTo(
|
||||||
top = name.bottom,
|
top = hw.bottom,
|
||||||
bottom = sig.top,
|
bottom = sig.top,
|
||||||
bias = 0F,
|
bias = 0F,
|
||||||
topMargin = 4.dp,
|
topMargin = 4.dp,
|
||||||
|
|
Ładowanie…
Reference in New Issue