Shared publicly  - 
 
#AndroidDev  

+Robert Ly and I just published a new Android training class titled Adding Animations, which quickly gets you up to speed on implementing common animations and transitions in your app with the new-ish android.animation APIs.

It covers basics like crossfades (dissolves), screen slides with ViewPager, card flips, zooms (although nothing on API 16 ActivityOptions yet), and automatic layout change animations.

And for those wondering about implementing all this android.animation goodness on earlier versions of the platform, take a look at +Jake Wharton's awesome NineOldAndroids library, at least as a starting point.

LINK: http://developer.android.com/training/animation/index.html
101
32
Patryk Zabicki's profile photoFabio Bonassi's profile photoAlan Jeon (skyisle)'s profile photolei wang's profile photo
21 comments
 
Displaying Card Flip Animations: card_flip_right_in.xml is mentioned twice and card_flip_left_in.xml is missing in the list of files at the top.
 
Thanks Sebastian, I'll be sure to fix the mistakes that will undoubtedly pop up in the next few days :D.
 
This page gets better every day. Love it! Keep it up!
 
+Roman Nurik There is a typo referencing the crossfade sample on the layout animation page:

"If you want to jump ahead and see a full working example, download and run the sample app and select the Crossfade example. See the following files for the code implementation:"
 
Some sort of code example for the "swipe to delete" you often use in Android Design in Action would be great, both for ListItem and simple View. Thank you! (great work)
 
I totally agree with +David Corsalini that a swipe example would be nice. Maybe also in a sense to change the state of a list item by swipping it but not deleting it. More like "swipe to 'mark as read'".
 
Is there an easy way to customize a ViewPager's scroll transition animations? I'd love to be able to implement something like the slide & zoom and overscroll "tilt" effect that is in the platform's all apps drawer.
 
+Jeff Gilfelt is there a way? yes. is it easy? probably not :-) you probably need to copy the source code for ViewPager and set the view's rotation on overscroll instead of calling to EdgeEffectCompat.
 
That's really good material...
Having some "official" ( ie some correct, approved ) ways to do some nice animations and eye candies are an very valuable addition to the Android developer site.
It will let all developer add them easily, and it will largely improve the quality of the released applications !
Too bad it's for Android > 4.0 only !
A lot of people ( including me with my glorious Nexus One ) can't be targeted with this animations...
It also mean that for a developer, targetting such a restricted audience is quite risky !
 
I'm working on a new app while learning how to code for Android. Your timing couldn't have been better. 
 
+Roman Nurik +Robert Ly would be nice if the download project would be an Eclipse project as Eclipse and ADT is the standard tooling for Android development. ;-)
 
+Lars Vogel We remain agnostic in regards to IDEs with our samples. Hopefully the extra import step isn't too much of a hassle ;P
 
+Robert Ly not for me but given my experience with training people in Eclipse and Android you would be surprised how much this is a problem for the average developer. :-)

But no worries, if that is the policy, this is good. I'm all for consistency.
 
+Roman Nurik +Robert Ly I was experimenting with the card flip animation for a Fragment, but all avenues I found eventually dead ended. It seems the compatibility library FragmentManager can only deal with anim resources. And since the animation MUST come from a resource it can't utilize nineoldandroid. Furthermore, the anim resource seems to only do 2D rotation. Last, the anim resource doesn't seem to accept custom Animation implementations (I think there's an issue logged for that feature), I was trying to use Rotate3dAnimation from the ApiDemoes.

If you don't know (or it's not possible) of a way to get the animation into Fragment transition, can you think of a clean way to degrade on older API? All I can see currently is having duplicate Fragments, one from support library, the other from native library. And then basically branching my Activity to use real Fragments when it can and support Fragments otherwise, with no real nice way to at least reuse the code that isn't dependent on which Fragment is used.
 
+Roman Nurik from the documentation, I saw the video for quick view how do you create the mp4, Is there any tool available for that?
 
+Dandre Allison Did you ever find a solution for this? I'd also like to use 3D animations for fragment transitions, but with support for < 3.0.
Add a comment...