What I'm trying to achieve is to override the start activity animation.
The animation should give the impression that the old activity is on top of the new activity, and then slides down and out of the screen to reveal the new activity. I've tried multiple ways such as using overridePendingTransition(startAnim, exitAnim)
But the problem is they both animate in the same timeline. So overridePendingTransition(R.anim.hold, R.anim.exit_slide_down);
You never see the exit animation because the new activity is on top. Can this be achieved using the framework?
The solution that works for me:
R.anim.exit_slide_down
...and then
I've been trying to solve your solution in a sample project and I got it working with this code:
Call the animation with:
R.anim.push_down_in:
R.anim.push_down_out:
Actually, I've found a property called
android:zAdjustment
in the animation files.If I put
android:zAdjustment="bottom"
inhold.xml
(screen 2) andandroid:zAdjustment="top"
inpush_down_out.xml
(screen 1) then I can get the desired effect.This gets around the z order issue (I assumed it was an issue with animation timings so I was barking up the wrong tree).
John