Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle animation for bottom bar transitions and standard transitions #700

Open
ryancstack opened this issue Nov 9, 2024 · 1 comment
Open

Comments

@ryancstack
Copy link

Is there a way to handle animations differently when navigating between BottomBar items compared to other standard navigations? It's difficult to differentiate within the AnimationStyle if the start destination is the first tab item for example because the top parent in the nav graph will always be that route.

My BottomBar implementation follows the same as the sample app:

// ...
            onClick = {
              if (isCurrentDestOnBackStack) {
                // When we click again on a bottom bar item and it was already selected
                // we want to pop the back stack until the initial destination of this bottom bar
                // item
                navigator.popBackStack(destination.direction, false)
                return@NavigationBarItem
              }

              navigator.navigate(destination.direction) {
                popUpTo(NavGraphs.root) { saveState = true }

                launchSingleTop = true

                restoreState = true
              }
            },
@ryancstack
Copy link
Author

@raamcosta do you have any tips or suggestions for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant