Andrey Kachur
01/25/2024, 9:15 PM@Composable
fun NavigationGraph(
navController: NavHostController
) {
NavHost(navController, startDestination = Navigation.First.route) {
/* shown after Navigation.Notification screen, but it is expected to be first */
composable(Navigation.First.route) {
//...
}
composable(Navigation.Second.route) {
//...
}
}
LaunchedEffect(Unit) {
/* shown before startDestination screen, but it is expected after Navigation.First */
navController.navigate(Navigation.Notification.route)
}
}
Andrei Mandychev
01/31/2024, 10:33 AM@Composable
fun NavigationGraph(
navController: NavHostController
) {
val nestedNavController = rememberNavController()
NavHost(nestedNavController, startDestination = Navigation.First.route) {
/* shown after Navigation.Notification screen, but it is expected to be first */
composable(Navigation.First.route) {
//...
// TODO use your navController to go the parent graph
}
composable(Navigation.Second.route) {
//...
}
}
LaunchedEffect(Unit) {
/* shown before startDestination screen, but it is expected after Navigation.First */
nestedNavController.navigate(Navigation.Notification.route)
}
}
Andrey Kachur
01/31/2024, 11:06 AMAndrey Kachur
01/31/2024, 11:09 AM