How can I trigger animations on individual views when switching activities?
I.e. if the user clicks a button to go to the next page, I’d like some of my views to fly off screen, and have the background crossfade into the next screen, instead of having the whole screen be animated as one piece.
Is this possible? And if so, how should it be done? (I’m using the most recent API, 4.1, and it doesn’t have to be backwards compatible)
EDIT: Currently, doing the transition-in animation is working fine by calling it in onResume(), but when I press back, the activity switches faster than any animations started in onPause() so that makes me think there’s a better way/place to do this.
What ever starts the event ex. button click would need to start the animations before start activity is called.
Since every event that starts a new activity is going to have animation code I would also recommend moving it into some sort of helper class to avoid having duplicate code all over the place. ex.
This is all sudo java code but hopefully enough for you to get the idea. Good luck!