mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
feat: show online and total node count in the title bar (#2209)
This commit is contained in:
parent
450014a0f6
commit
c4c115b901
3 changed files with 27 additions and 1 deletions
|
|
@ -376,10 +376,15 @@ private fun MainAppBar(
|
|||
return
|
||||
}
|
||||
val title by viewModel.title.collectAsStateWithLifecycle("")
|
||||
val onlineNodeCount by viewModel.onlineNodeCount.collectAsStateWithLifecycle(0)
|
||||
val totalNodeCount by viewModel.totalNodeCount.collectAsStateWithLifecycle(0)
|
||||
TopAppBar(
|
||||
title = {
|
||||
val title = when {
|
||||
currentDestination == null || isTopLevelRoute -> stringResource(id = R.string.app_name)
|
||||
currentDestination == null -> stringResource(id = R.string.app_name)
|
||||
|
||||
currentDestination.hasRoute<NodesRoutes.Nodes>() -> stringResource(id = R.string.app_name) +
|
||||
" ($onlineNodeCount/$totalNodeCount)"
|
||||
|
||||
currentDestination.hasRoute<Route.DebugPanel>() -> stringResource(id = R.string.debug_panel)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue