I am currently working with Activity Transitions and Shared Elements.
I understand how the content Transitions work. They play in this order when going A -> B :
And then when going B -> A :
Also to be able to see all these Transitions one after the other, the two following attributes must be set to false :
Now come into play the Shared Element Transitions!
I notice that no matter the configuration, the Transition SharedElementExitTransition is never played.
No matter what it it always the SharedElementEnterTransition that is used.
So far I tried :
In all these situations ShareElementExitTransition is never used!
Thank you in advance for your answers.
The SharedElementExitTransition is for doing something to the shared element prior to moving it to the called Activity. For example, you may want to lift it and move it to the center of the screen before the called Activity takes over.
The important part is that the shared element exit transition is executed after you call startActivity
. So you must make the change to the shared element at that point. Essentially, you do this:
startActivity(intent, activityOptionsBundleWithTransitions);
manipulateSharedElement();
Then the shared element exit transition will execute and not transfer the shared element until after it completes. Shared element exit transitions are rarely used.