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

TimeAnimator

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
mListener
private long
mPreviousTime
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;
    
voidinitAnimation()

        // noop
    
public voidsetCurrentPlayTime(long playTime)

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

param
listener the listener to be set.

        mListener = listener;
    
public voidstart()


    
       
        mPreviousTime = -1;
        super.start();