kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
feat: adds UI for unknown node details (#1219)
rodzic
e3c795d856
commit
858544b0f4
|
@ -154,10 +154,12 @@ jobs:
|
|||
script: echo "Generated AVD snapshot for caching."
|
||||
|
||||
- uses: reactivecircus/android-emulator-runner@v2
|
||||
env:
|
||||
ANDROID_EMULATOR_WAIT_TIME_BEFORE_KILL: 60
|
||||
with:
|
||||
api-level: ${{ matrix.api-level }}
|
||||
arch: x86_64
|
||||
force-avd-creation: false
|
||||
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
|
||||
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -no-metrics -camera-back none
|
||||
disable-animations: true
|
||||
script: ./gradlew connectedFdroidDebugAndroidTest
|
||||
|
|
|
@ -87,7 +87,16 @@ fun NodeInfo(
|
|||
val (textColor, nodeColor) = thatNodeInfo.colors
|
||||
|
||||
val position = thatNodeInfo.position
|
||||
val hwInfoString = thatNodeInfo.user?.hwModelString
|
||||
val hwInfoString = thatNodeInfo.user?.hwModelString ?: MeshProtos.HardwareModel.UNSET.name
|
||||
val roleName =
|
||||
if (isUnknownUser) {
|
||||
DeviceConfig.Role.UNRECOGNIZED.name
|
||||
} else {
|
||||
thatNodeInfo.user?.role?.let { role ->
|
||||
DeviceConfig.Role.forNumber(role)?.name
|
||||
} ?: DeviceConfig.Role.UNRECOGNIZED.name
|
||||
}
|
||||
val nodeId = thatNodeInfo.user?.id ?: "???"
|
||||
|
||||
val highlight = Color(0x33FFFFFF)
|
||||
val bgColor by animateColorAsState(
|
||||
|
@ -246,26 +255,25 @@ fun NodeInfo(
|
|||
Spacer(modifier = Modifier.height(4.dp))
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.SpaceBetween
|
||||
) {
|
||||
if (hwInfoString != null) {
|
||||
Text(
|
||||
text = "$hwInfoString",
|
||||
fontSize = MaterialTheme.typography.button.fontSize,
|
||||
style = style,
|
||||
)
|
||||
}
|
||||
val role = thatNodeInfo.user?.role
|
||||
role?.let {
|
||||
Text(
|
||||
text = DeviceConfig.Role.forNumber(it).name,
|
||||
fontSize = MaterialTheme.typography.button.fontSize
|
||||
)
|
||||
}
|
||||
val nodeId = thatNodeInfo.user?.id
|
||||
if (nodeId != null) {
|
||||
Text(text = nodeId, fontSize = MaterialTheme.typography.button.fontSize)
|
||||
}
|
||||
Text(
|
||||
modifier = Modifier.weight(1f),
|
||||
text = hwInfoString,
|
||||
fontSize = MaterialTheme.typography.button.fontSize,
|
||||
style = style,
|
||||
)
|
||||
Text(
|
||||
modifier = Modifier.weight(1f),
|
||||
text = roleName,
|
||||
textAlign = TextAlign.Center,
|
||||
fontSize = MaterialTheme.typography.button.fontSize
|
||||
)
|
||||
Text(
|
||||
modifier = Modifier.weight(1f),
|
||||
text = nodeId,
|
||||
textAlign = TextAlign.End,
|
||||
fontSize = MaterialTheme.typography.button.fontSize
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,8 @@ class NodeInfoPreviewParameterProvider: PreviewParameterProvider<NodeInfo> {
|
|||
longName = "Micky Mouse",
|
||||
shortName = "MM",
|
||||
id = "mickeyMouseId",
|
||||
hwModel = MeshProtos.HardwareModel.TBEAM
|
||||
hwModel = MeshProtos.HardwareModel.TBEAM,
|
||||
role = 0,
|
||||
),
|
||||
hopsAway = 0
|
||||
)
|
||||
|
|
Ładowanie…
Reference in New Issue