Skip to content

Commit

Permalink
Merge pull request #15 from mende273/remember_bottom_bar_selection_on…
Browse files Browse the repository at this point in the history
…_orientation_change

Remember the selected menu item from the bottom navigation bar on ori…
  • Loading branch information
mende273 authored Mar 9, 2023
2 parents 89dfd05 + 8854109 commit 84476d8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.jumrukovski.quotescompose.ui.shared
import androidx.compose.material3.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
Expand All @@ -16,7 +16,7 @@ import com.jumrukovski.quotescompose.ui.theme.NavigationBarSelectedItemColor

@Composable
fun BottomNavigationBar(onItemClick: (BottomMenuItem) -> Unit = {}) {
val selectedIndex = remember { mutableStateOf(0) }
val selectedIndex = rememberSaveable{ mutableStateOf(0) }

NavigationBar(
modifier = Modifier,
Expand Down

0 comments on commit 84476d8

Please sign in to comment.