Skip to content

Commit

Permalink
Fix untagged color
Browse files Browse the repository at this point in the history
  • Loading branch information
anod committed Sep 12, 2024
1 parent 78195b9 commit 79022a0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/src/main/java/com/anod/appwatcher/watchlist/MainDrawer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,14 @@ private fun DrawerContent(mainState: MainViewState, onMainEvent: (MainViewEvent)
)

mainState.tags.forEach { (tag, count) ->
val renderedTag = if (tag.isEmpty) tag.copy(name = stringResource(R.string.untagged), color = MaterialTheme.colorScheme.primaryContainer.toArgb()) else tag
NavigationDrawerItem(
icon = { TagIcon(outlined = true, contentDescription = tag.name) },
label = { Text(if (tag.isEmpty) stringResource(R.string.untagged) else tag.name) },
badge = { TagBadge(if (tag.isEmpty) MaterialTheme.colorScheme.primaryContainer else Color(tag.color), count) },
icon = { TagIcon(outlined = true, contentDescription = renderedTag.name) },
label = { Text(renderedTag.name) },
badge = { TagBadge(Color(tag.color), count) },
selected = false,
onClick = {
onMainEvent(MainViewEvent.NavigateToTag(tag))
onMainEvent(MainViewEvent.NavigateToTag(renderedTag))
},
modifier = Modifier.padding(NavigationDrawerItemDefaults.ItemPadding).height(42.dp)
)
Expand Down

0 comments on commit 79022a0

Please sign in to comment.