Keyframe
public
abstract
class
Keyframe
extends Object
implements
Cloneable
| java.lang.Object | |
| ↳ | android.animation.Keyframe |
This class holds a time/value pair for an animation. The Keyframe class is used
by ValueAnimator to define the values that the animation target will have over the course
of the animation. As the time proceeds from one keyframe to the other, the value of the
target object will animate between the value at the previous keyframe and the value at the
next keyframe. Each keyframe also holds an optional TimeInterpolator
object, which defines the time interpolation over the intervalue preceding the keyframe.
The Keyframe class itself is abstract. The type-specific factory methods will return
a subclass of Keyframe specific to the type of value being stored. This is done to improve
performance when dealing with the most common cases (e.g., float and
int values). Other types will fall into a more general Keyframe class that
treats its values as Objects. Unless your animation requires dealing with a custom type
or a data structure that needs to be animated directly (and evaluated using an implementation
of TypeEvaluator), you should stick to using float and int as animations using those
types have lower runtime overhead than other types.