In an activity, I’m trying to make a custom transition between two Activities. I want the current Activity to shrink towards its to about half its size, then have the x-values perform a scale transformation so it looks as if the Activity is rotating in 3-D. Then, after that animation is over, I want the same animation in the exact opposite order to happen on the new Activity.
My question is, how can I have a pause in the animation, so that the animation for the entering Activity does not start until after the exiting animation has ended? I have to use the overridePendingTransition method, so all animations passed must be int values from R.anim. Otherwise, it would be easy using AnimationListener. But I cannot think of a way to do it.
Any ideas?
EDIT: I’ve since figured it out, so you can check out the answers!
For anyone who is trying to accomplish the same thing, I figured it out. The secret is to use android:startOffset in the XML. The code is as follows:
The exit animation:
The entrance animation:
Then the Java code:
This creates a smooth, well-timed animation that makes it seem as if the next Activity being created is on the “back” of the current Activity.