Compose Navigation destination animation transitions by conditional

463 Views Asked by At

For certain destination screens, I would like a certain transition animations to happen only when navigating to or from certain other destinations.

For example, when navigating to and from Category screen from the bottom Nav bar, I would like to have no or default animation transition, but if I'm navigating to a sub-screen of Category screen, ie by clicking on an item, I would like slide animation.

How can I write a conditional in my exitTransition/popEnterTransition/popExitTransition to check: a. the screen I am navigating to b. the screen that was just popped

Checking navController's backstack can't work since the previous screen is already popped.

0

There are 0 best solutions below