Reputation: 17798
I have a list of elements and when I click one, I replace the fragment and use addSharedElement
for the FragmentTransaction
to animate the item in the list to become the header in the detail view.
Now I want to populate some details in the detail view, but only AFTER the header animation has finished. Because now, the header animation appears OVER the content and that does not look very good.
How can I achieve that?
Upvotes: 2
Views: 1566
Reputation: 906
I hope I'm not too late. You can retrieve the shared elements transition from getWindow()
then hook a listener to it.
getWindow().getSharedElementEnterTransition().addListener(new Transition.TransitionListener() {
@Override
public void onTransitionStart(Transition transition) {
// put your code here
}
...
});
Upvotes: 4