Skip to content

Instantly share code, notes, and snippets.

@ifucolo
Created August 22, 2025 09:45
Show Gist options
  • Select an option

  • Save ifucolo/5272246d804e06ed62142b379dcaea87 to your computer and use it in GitHub Desktop.

Select an option

Save ifucolo/5272246d804e06ed62142b379dcaea87 to your computer and use it in GitHub Desktop.
@Composable
fun NavigationBarForNavDisplay(
currentRoute: AppRoutes?,
onNavigate: (AppRoutes) -> Unit
) {
NavigationBar(
containerColor = MaterialTheme.colorScheme.surface,
contentColor = MaterialTheme.colorScheme.surface,
tonalElevation = SanctusDimensions.elevation
) {
bottomNavItems.forEach { screen ->
val navUtils = getNavUtils(screen)
NavigationBarItem(
icon = {
Icon(
modifier = Modifier.size(SanctusDimensions.iconSizeSmall) ,
painter = painterResource(id = navUtils.iconResource),
contentDescription = stringResource(navUtils.titleResource),
)
},
colors = NavigationBarItemDefaults.colors(
indicatorColor = MaterialTheme.colorScheme.surface,
selectedIconColor = MaterialTheme.colorScheme.primary,
unselectedIconColor = MaterialTheme.colorScheme.primary,
selectedTextColor = MaterialTheme.colorScheme.primary,
unselectedTextColor = MaterialTheme.colorScheme.primary
),
label = {
LabelMediumText(
color = MaterialTheme.colorScheme.primary,
text = stringResource(navUtils.titleResource)
)
},
selected = currentRoute == screen,
onClick = {
onNavigate(screen)
},
)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment