public class TimeAnimator extends ValueAnimator
Modifier and Type | Class and Description |
---|---|
static interface |
TimeAnimator.TimeListener
Implementors of this interface can set themselves as update listeners
to a
TimeAnimator instance to receive callbacks on every animation
frame to receive the total time since the animator started and the delta time
since the last frame. |
ValueAnimator.AnimatorUpdateListener, ValueAnimator.RepeatMode
Animator.AnimatorListener, Animator.AnimatorPauseListener
INFINITE, RESTART, REVERSE
DURATION_INFINITE
Constructor and Description |
---|
TimeAnimator() |
Modifier and Type | Method and Description |
---|---|
void |
setCurrentPlayTime(long playTime)
Sets the position of the animation to the specified point in time.
|
void |
setTimeListener(TimeAnimator.TimeListener listener)
Sets a listener that is sent update events throughout the life of
an animation.
|
void |
start()
Starts this animation.
|
addUpdateListener, cancel, canReverse, clone, commitAnimationFrame, doAnimationFrame, end, getAnimatedFraction, getAnimatedValue, getAnimatedValue, getCurrentAnimationsCount, getCurrentPlayTime, getDuration, getDurationScale, getFrameDelay, getInterpolator, getRepeatCount, getRepeatMode, getStartDelay, getTotalDuration, getValues, isRunning, isStarted, ofArgb, ofFloat, ofInt, ofObject, ofPropertyValuesHolder, pause, removeAllUpdateListeners, removeUpdateListener, resume, reverse, setAllowRunningAsynchronously, setCurrentFraction, setDuration, setDurationScale, setEvaluator, setFloatValues, setFrameDelay, setInterpolator, setIntValues, setObjectValues, setRepeatCount, setRepeatMode, setStartDelay, setValues, toString
addListener, addPauseListener, appendChangingConfigurations, createConstantState, getChangingConfigurations, getListeners, isPaused, removeAllListeners, removeListener, removePauseListener, setChangingConfigurations, setTarget, setupEndValues, setupStartValues
public void start()
Animator
Animator.AnimatorListener.onAnimationStart(Animator)
for any listeners of this animator.
The animation started by calling this method will be run on the thread that called this method. This thread should have a Looper on it (a runtime exception will be thrown if this is not the case). Also, if the animation will animate properties of objects in the view hierarchy, then the calling thread should be the UI thread for that view hierarchy.
start
in class ValueAnimator
public void setCurrentPlayTime(long playTime)
ValueAnimator
setCurrentPlayTime
in class ValueAnimator
playTime
- The time, in milliseconds, to which the animation is advanced or rewound.public void setTimeListener(TimeAnimator.TimeListener listener)
listener
- the listener to be set.