From 156b369862bd4b7e580614cfac7fc097d30a7a6c Mon Sep 17 00:00:00 2001 From: Rifat Azad Date: Thu, 26 Dec 2024 23:09:46 +0600 Subject: [PATCH] manager: hdie bottom navbar on action screen --- .../java/com/rifsxd/ksunext/ui/MainActivity.kt | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/manager/app/src/main/java/com/rifsxd/ksunext/ui/MainActivity.kt b/manager/app/src/main/java/com/rifsxd/ksunext/ui/MainActivity.kt index 77c6f47b..bd26cb71 100644 --- a/manager/app/src/main/java/com/rifsxd/ksunext/ui/MainActivity.kt +++ b/manager/app/src/main/java/com/rifsxd/ksunext/ui/MainActivity.kt @@ -34,8 +34,10 @@ import androidx.compose.ui.unit.dp import androidx.navigation.NavBackStackEntry import androidx.navigation.NavHostController import androidx.navigation.compose.rememberNavController +import androidx.navigation.compose.currentBackStackEntryAsState import com.ramcosta.composedestinations.DestinationsNavHost import com.ramcosta.composedestinations.animations.NavHostAnimatedDestinationStyle +import com.ramcosta.composedestinations.generated.destinations.ExecuteModuleActionScreenDestination import com.ramcosta.composedestinations.generated.NavGraphs import com.ramcosta.composedestinations.utils.isRouteOnBackStackAsState import com.ramcosta.composedestinations.utils.rememberDestinationsNavigator @@ -78,8 +80,19 @@ class MainActivity : ComponentActivity() { KernelSUTheme { val navController = rememberNavController() val snackBarHostState = remember { SnackbarHostState() } + val currentDestination = navController.currentBackStackEntryAsState()?.value?.destination + + val showBottomBar = when (currentDestination?.route) { + ExecuteModuleActionScreenDestination.route -> false // Hide for HomeScreen + else -> true + } + Scaffold( - bottomBar = { BottomBar(navController) }, + bottomBar = { + if (showBottomBar) { + BottomBar(navController) + } + }, contentWindowInsets = WindowInsets(0, 0, 0, 0) ) { innerPadding -> CompositionLocalProvider(