pull/54/head
Saeed Noshadi 3 years ago
parent faf87c70d2
commit ffec6f8b5d

@ -155,16 +155,15 @@ private fun NiABottomBar(
), ),
tonalElevation = 0.dp tonalElevation = 0.dp
) { ) {
var indexOfSelectedItem by rememberSaveable {
var selected by rememberSaveable {
mutableStateOf(0) mutableStateOf(0)
} }
TOP_LEVEL_DESTINATIONS.forEachIndexed { index, destination -> TOP_LEVEL_DESTINATIONS.forEachIndexed { itemIndex, destination ->
val isSelect = selected == index val isSelect = indexOfSelectedItem == itemIndex
NavigationBarItem( NavigationBarItem(
selected = isSelect, selected = isSelect,
onClick = { onClick = {
selected = index indexOfSelectedItem = itemIndex
onNavigateToTopLevelDestination(destination) onNavigateToTopLevelDestination(destination)
}, },
icon = { icon = {

Loading…
Cancel
Save