Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
public class

TimeAnimator

extends ValueAnimator
java.lang.Object
   ↳ android.animation.Animator
     ↳ android.animation.ValueAnimator
       ↳ android.animation.TimeAnimator

Class Overview

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.

Summary

Nested Classes
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. 
[Expand]
Inherited Constants
From class android.animation.ValueAnimator
Public Constructors
TimeAnimator ()
Public Methods
void setTimeListener ( TimeAnimator.TimeListener listener)
Sets a listener that is sent update events throughout the life of an animation.
void start ()
Starts this animation.
[Expand]
Inherited Methods
From class android.animation.ValueAnimator
From class android.animation.Animator
From class java.lang.Object

Public Constructors

public TimeAnimator ()

Public Methods

public void setTimeListener ( TimeAnimator.TimeListener listener)

Sets a listener that is sent update events throughout the life of an animation.

Parameters
listener the listener to be set.

public void start ()

Starts this animation. If the animation has a nonzero startDelay, the animation will start running after that delay elapses. A non-delayed animation will have its initial value(s) set immediately, followed by calls to 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.