How to configure explode fragment transition in order for view to move along the vertical axis only

Viewed 691

I am trying to animate a transition between 2 fragments in my activity using an Explode animation. What I am trying to achieve is to explode everything away from a View which is located somewhere in the middle and matches the screen from left to right (it is a list row).

I would like to restrict the movement to Y-axis only. Views should only move vertically. Views which are above the epicenter view go up, views which are below should go down.

At the moment all views seem to move away from a point in all directions.

How can I achieve vertical movement only?

My transition:

        Explode explode = new Explode();
        explode.setEpicenterCallback(edited.holder().epicenter());
        listFragment.setExitTransition(explode);

Epicenter callback (holder().epicenter()):

return Rect(rowView.left, rowView.top, rowView.right, rowView.bottom)

I have also tried this to no effect

return Rect(rowView.left - 2000000000, rowView.top, rowView.right + 2000000000, rowView.bottom)
0 Answers
Related