From 39b68ed29f3ab2bf44d940eb692d1e5d50a33ccd Mon Sep 17 00:00:00 2001 From: Anurag Kanojiya Date: Sun, 6 Oct 2024 14:35:29 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Change=20order=20of=20buttons=20?= =?UTF-8?q?in=20Bottom=20App=20Bar=20(#226)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Changing order of buttons in Bottom App Bar * Updated routes according to order of options * Delete .idea/misc.xml * Delete .idea/appInsightsSettings.xml --- .idea/misc.xml | 10 ---------- .../view/composable/MyBottomAppBar.kt | 20 +++++++++---------- 2 files changed, 10 insertions(+), 20 deletions(-) delete mode 100644 .idea/misc.xml diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 0ad17cbd..00000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/java/com/lorenzovainigli/foodexpirationdates/view/composable/MyBottomAppBar.kt b/app/src/main/java/com/lorenzovainigli/foodexpirationdates/view/composable/MyBottomAppBar.kt index 517a13a3..ffb84ac7 100644 --- a/app/src/main/java/com/lorenzovainigli/foodexpirationdates/view/composable/MyBottomAppBar.kt +++ b/app/src/main/java/com/lorenzovainigli/foodexpirationdates/view/composable/MyBottomAppBar.kt @@ -29,12 +29,6 @@ fun MyBottomAppBar( currentDestination: String? ){ val navigationItems = listOf( - NavigationItem( - label = stringResource(id = R.string.about_this_app), - route = Screen.AboutScreen.route, - selectedIcon = Icons.Filled.Info, - unselectedIcon = Icons.Outlined.Info - ), NavigationItem( label = stringResource(id = R.string.list), route = Screen.MainScreen.route, @@ -46,13 +40,19 @@ fun MyBottomAppBar( route = Screen.SettingsScreen.route, selectedIcon = Icons.Filled.Settings, unselectedIcon = Icons.Outlined.Settings - ) + ), + NavigationItem( + label = stringResource(id = R.string.about_this_app), + route = Screen.AboutScreen.route, + selectedIcon = Icons.Filled.Info, + unselectedIcon = Icons.Outlined.Info + ) ) NavigationBar { var selectedItem = when (currentDestination) { - Screen.AboutScreen.route -> 0 - Screen.SettingsScreen.route -> 2 - else -> 1 + Screen.AboutScreen.route -> 2 + Screen.SettingsScreen.route -> 1 + else -> 0 } navigationItems.forEachIndexed { index, item -> NavigationBarItem(