September 2016
Beginner to intermediate
1089 pages
23h 8m
English
The second way to manage animations in Android was introduced in Android 3.0 (API level 11). It is designed in a very generic way, so it can handle animations on any property of any object. The system is extensible and lets you animate properties of custom types as well.
There are many ways to use property animations. The simplest one is to use ValueAnimator. This is as easy as defining an animation that goes from one value to another, has a duration, and optionally an interpolator. Then you add a listener that is invoked each time there is a new value, and finally you start the animation.
This code will create a ValueAnimator that animates a float from 0 to 42 along 1,000 milliseconds:
ValueAnimator animation = ValueAnimator.ofFloat(0f, ...
Read now
Unlock full access