From 72a1cea7a5f269408b84c91962d5b1426219298f Mon Sep 17 00:00:00 2001 From: sathwikcs <85106054+sathwikcs@users.noreply.github.com> Date: Mon, 27 Jan 2025 17:58:18 +0530 Subject: [PATCH] Bye bye BottomNavBar.kt --- .../attendanceapp/navigation/BottomNavBar.kt | 48 ------------------- 1 file changed, 48 deletions(-) delete mode 100644 app/src/main/java/in/sminnovations/attendanceapp/navigation/BottomNavBar.kt diff --git a/app/src/main/java/in/sminnovations/attendanceapp/navigation/BottomNavBar.kt b/app/src/main/java/in/sminnovations/attendanceapp/navigation/BottomNavBar.kt deleted file mode 100644 index 4988d7a..0000000 --- a/app/src/main/java/in/sminnovations/attendanceapp/navigation/BottomNavBar.kt +++ /dev/null @@ -1,48 +0,0 @@ -package `in`.sminnovations.attendanceapp.navigation - -import androidx.compose.material3.NavigationBar -import androidx.compose.material3.NavigationBarItem -import androidx.compose.material3.Text -import androidx.compose.runtime.Composable -import androidx.compose.runtime.getValue -import androidx.navigation.NavController -import androidx.navigation.compose.currentBackStackEntryAsState -import `in`.sminnovations.attendanceapp.navigation.data.BottomNavItem - - -@Composable -fun BottomNavigationBar( - navController: NavController, - items: List, -) { - NavigationBar { - val navBackStackEntry by navController.currentBackStackEntryAsState() - val currentRoute = navBackStackEntry?.destination?.route - items.forEach { item -> - NavigationBarItem(icon = { - BottomNavAnimatedIcon( - isSelected = currentRoute == item.route, - icon = item.icon, - selectedIcon = item.selectedIcon, - contentDescription = item.label - ) - }, - label = { Text(text = item.label) }, - alwaysShowLabel = true, - selected = currentRoute == item.route, - onClick = { - navController.navigate(item.route) { - navController.graph.startDestinationRoute?.let { route -> - popUpTo(route) { - saveState = true - } - } - launchSingleTop = true - restoreState = true - } - }) - } - } - -} -