Android Compose Bottom Navigation

136
January 16, 2022, at 3:00 PM

I have a problem with compose bottom navigation bar. With starting screen to be exact. I have a navigation class :

fun Navigation() {
    val navController = rememberAnimatedNavController()
    AnimatedNavHost(navController = navController, startDestination = Screen.SplashScreen.route) {
        composable(route = Screen.SplashScreen.route,
            exitTransition = { ->
                slideOutHorizontally(
                    targetOffsetX = { -300 },
                    animationSpec = tween(
                        durationMillis = 300,
                        easing = FastOutSlowInEasing
                    )
                ) + fadeOut(animationSpec = tween(30))
            }
composable{...}
composable{...}
teamGraph(navController = navController)

}

As you can see I have nested navigation - teamrGraph. It looks like this:

fun NavGraphBuilder.teamGraph(navController: NavController) {
    navigation(
        route = "manager",
        startDestination = Screen.Screen1.route
    )
    {
        composable(route = Screen.TeamBaseScreen.route,
            enterTransition = { ->
                slideInHorizontally (
                    initialOffsetX = {300},
                    animationSpec = tween(
                        durationMillis = 300,
                        easing = FastOutSlowInEasing
                    )
                )  + fadeIn(animationSpec = tween(30))
            },
composable{...}
composable{...}

My problem is I dont know how to connect nested navigation to my bottom bar. Beacuse if I add main navigation class the starting point is splash screen. So let me show you ...

fun TeamBaseScreen(navController: NavController) {
    Scaffold(
        bottomBar = { BottomBar(navController = navController)}
    ) {
      Navigation()  <---- here is the problem
    }
}

Everything works well here but I want to use my nested navigation( teamGraph not Navigation()) so starting point is Screen1 not Splash Screen. How can I achieve that ?

Rent Charter Buses Company
READ ALSO
Align the non-paranted objects using js (responsive webite)

Align the non-paranted objects using js (responsive webite)

Here's an example of what I am trying to achieve:

132
How to animate any click event [duplicate]

How to animate any click event [duplicate]

I have written this code to remove an element now I want give any effect to it using jQuery

87
Checking my math for distance between 2 points in miles

Checking my math for distance between 2 points in miles

Hello I am trying to do a calculator of finding the distance between 2 pointsEverything works properly

121
How can I make a Horizontal scrolling nav bar that also works with mobile

How can I make a Horizontal scrolling nav bar that also works with mobile

So I have a website about the NBA and the problem is there is 30 teams in the NBAWhen I make a nav bar it takes up half the page because there is 30 teams lol

68