From 33e57bcfd764a5ced7dc12c6c9ed56a9771a6663 Mon Sep 17 00:00:00 2001 From: Fabian Zobrist Date: Sat, 21 Jan 2023 18:21:40 +0100 Subject: [PATCH] Show fab only on counter screen. --- app/src/main/java/me/zobrist/tichucounter/MainActivity.kt | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/app/src/main/java/me/zobrist/tichucounter/MainActivity.kt b/app/src/main/java/me/zobrist/tichucounter/MainActivity.kt index 011c2a6..09344dc 100644 --- a/app/src/main/java/me/zobrist/tichucounter/MainActivity.kt +++ b/app/src/main/java/me/zobrist/tichucounter/MainActivity.kt @@ -240,16 +240,10 @@ class MainActivity : BaseActivity() { onClick = { scope.launch { drawerState.close() } navController.navigate(screen.route) { - // Pop up to the start destination of the graph to - // avoid building up a large stack of destinations - // on the back stack as users select items popUpTo(navController.graph.findStartDestination().id) { saveState = true } - // Avoid multiple copies of the same destination when - // reselecting the same item launchSingleTop = true - // Restore state when reselecting a previously selected item restoreState = true } }, @@ -263,7 +257,7 @@ class MainActivity : BaseActivity() { drawerState, scope, navController, - counterViewModel.keyboardHidden + counterViewModel.keyboardHidden && (currentDestination?.hierarchy?.any { it.route == "counter" } == true) ) { counterViewModel.keyboardHidden = false } } }