mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
Feat/1919 pax graphs (#2477)
Signed-off-by: DaneEvans <dane@goneepic.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
d6354f7d0f
commit
ee99d79574
7 changed files with 507 additions and 12 deletions
|
|
@ -237,6 +237,14 @@ internal fun DebugItem(
|
|||
color = colorScheme.onSurface
|
||||
)
|
||||
)
|
||||
// Show decoded payload if available
|
||||
if (!log.decodedPayload.isNullOrBlank()) {
|
||||
DecodedPayloadBlock(
|
||||
decodedPayload = log.decodedPayload,
|
||||
isSelected = isSelected,
|
||||
colorScheme = colorScheme
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -780,3 +788,48 @@ private suspend fun exportAllLogs(context: Context, logs: List<UiMeshLog>) = wit
|
|||
warn("Error:IOException: " + e.toString())
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun DecodedPayloadBlock(
|
||||
decodedPayload: String,
|
||||
isSelected: Boolean,
|
||||
colorScheme: ColorScheme
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.debug_decoded_payload),
|
||||
style = TextStyle(
|
||||
fontSize = if (isSelected) 10.sp else 8.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = colorScheme.primary
|
||||
),
|
||||
modifier = Modifier.padding(top = 8.dp, bottom = 4.dp)
|
||||
)
|
||||
Text(
|
||||
text = "{",
|
||||
style = TextStyle(
|
||||
fontSize = if (isSelected) 10.sp else 8.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = colorScheme.primary
|
||||
),
|
||||
modifier = Modifier.padding(start = 8.dp, bottom = 2.dp)
|
||||
)
|
||||
Text(
|
||||
text = decodedPayload,
|
||||
softWrap = true,
|
||||
style = TextStyle(
|
||||
fontSize = if (isSelected) 10.sp else 8.sp,
|
||||
fontFamily = FontFamily.Monospace,
|
||||
color = colorScheme.onSurface.copy(alpha = 0.8f)
|
||||
),
|
||||
modifier = Modifier.padding(start = 16.dp, bottom = 0.dp)
|
||||
)
|
||||
Text(
|
||||
text = "}",
|
||||
style = TextStyle(
|
||||
fontSize = if (isSelected) 10.sp else 8.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = colorScheme.primary
|
||||
),
|
||||
modifier = Modifier.padding(start = 8.dp, bottom = 4.dp)
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue