By Khaled Anaqwa
The Android framework provides two
property animation (introduced in Android
view animation. (using XML)
Both animation systems are viable
options, but the property animation
system, in general, is the preferred
method to use, because it is more flexible
and offers more features.
Introduced in Android 3.0 (API level 11)
lets you animate properties of any object,
including ones that are not rendered to
The system is extensible and lets you
animate properties of custom types as
Is a robust framework that allows you to
animate almost anything.
You can define an animation to change
any object property over time, regardless
of whether it draws to the screen or not.
it’s changes a property's (a field in an
object) value over a specified length of
Duration (The default length is 300 ms)
Time interpolation (function of the animation’s)
Repeat count and behavior
Animator sets (You can group animations into
logical sets that play together or sequentially or
after specified delays)
Frame refresh delay (The default is set to
refresh every 10 ms)
The Animator class provides the basic
structure for creating animations.
You normally do not use this class directly
as it only provides minimal functionality
that must be extended to fully support
Subclasses of Animator used
This class provides a simple timing engine for running animations which
calculate animated values and set them on target objects.
This subclass of ValueAnimator provides support for animating
properties on target objects.
The constructors of this class take parameters to define the target
object that will be animated as well as the name of the property that
will be animated.
it makes the process of animating values on target objects much
ObjectAnimator has a few more restrictions(Use ValueAnimator).
Provides a mechanism to group animations together so that they run
in relation to one another.
You can set animations to play together, sequentially, or after a
Animating with ValueAnimator
ValueAnimator animation= ValueAnimator.ofFloat(0f, 1f);
public void onAnimationUpdate(ValueAnimator
Float value = (Float)
Float frac =
AnimatorSet set1= new AnimatorSet();
Note : you can play set into another set
AnimatorSet set2= new AnimatorSet();