O'Reilly logo

Android 3.0 Animations by Alex Shaw

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Animating values with ValueAnimator

ValueAnimator is the superclass of ObjectAnimator, so it has a lot in common with it. It does not provide the same factory methods that allow you to directly animate an object, but it does have very similar factory methods. It also does not automatically connect to an object; you have to do that yourself.

So instead of changing an object, you have to implement a handler that will receive a new value every time the Animator performs an update. This could be any sort of class; it doesn't even need to be connected to a view.

Let's learn some more by working with an example.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required