Monster Brain
Monster Brain

Reputation: 2119

Shared Element Transition using Jetpack Compose with Navigation, doesn't work in back navigation popBackStack

In our project We are using the compose animation (beta01) which includes the shared transition (sharedElement), with Navigation, as mentioned here: https://developer.android.com/develop/ui/compose/animation/shared-elements/navigation

We have a Screen A -> Screen B transition, where an image is shared Element. it Works fine in Forward click. However when going back to Screen A, the behavior is like this.

When there is no navArgs, it works fine in all cases. When there is some navArgs, when we use back gesture of device to go back it works fine. When there is some navArgs, when we use manual popBackStack or navigateUp, shared transition doesn't work and it just fades out to next screen.

What could be the possible cause ? Is there a need to add navArgs when popping the back Stack ?

I tried passing some arguments back, but it doesn't seem to have any effect.

Upvotes: 0

Views: 369

Answers (0)

Related Questions