TimeAnimator.javaAPI DocAndroid 5.1 API3527Thu Mar 12 22:22:08 GMT 2015android.animation


public class TimeAnimator extends ValueAnimator
This class provides a simple callback mechanism to listeners that is synchronized with all other animators in the system. There is no duration, interpolation, or object value-setting with this Animator. Instead, it is simply started, after which it proceeds to send out events on every animation frame to its TimeListener (if set), with information about this animator, the total elapsed time, and the elapsed time since the previous animation frame.

Fields Summary
private TimeListener
private long
Constructors Summary
Methods Summary
voidanimateValue(float fraction)

        // Noop
booleananimationFrame(long currentTime)

        if (mListener != null) {
            long totalTime = currentTime - mStartTime;
            long deltaTime = (mPreviousTime < 0) ? 0 : (currentTime - mPreviousTime);
            mPreviousTime = currentTime;
            mListener.onTimeUpdate(this, totalTime, deltaTime);
        return false;

        // noop
public voidsetCurrentPlayTime(long playTime)

        long currentTime = AnimationUtils.currentAnimationTimeMillis();
        mStartTime = Math.max(mStartTime, currentTime - playTime);
public voidsetTimeListener(android.animation.TimeAnimator$TimeListener listener)
Sets a listener that is sent update events throughout the life of an animation.

listener the listener to be set.

        mListener = listener;
public voidstart()

        mPreviousTime = -1;