Added in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# TimeAnimator

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/android/animation/TimeAnimator "View this page in Java")

```
open class TimeAnimator : ValueAnimator
```

|---|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||||
| ↳ | [android.animation.Animator](https://developer.android.com/reference/kotlin/android/animation/Animator) |||
|   | ↳ | [android.animation.ValueAnimator](https://developer.android.com/reference/kotlin/android/animation/ValueAnimator) ||
|   |   | ↳ | [android.animation.TimeAnimator](https://developer.android.com/reference/kotlin/android/animation/TimeAnimator#) |

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 ||
|---|---|
| abstract | `https://developer.android.com/reference/kotlin/android/animation/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. |

| Inherited constants ||
|---|---|
| From class `https://developer.android.com/reference/kotlin/android/animation/Animator` |---|---| | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/android/animation/Animator#DURATION_INFINITE:kotlin.Long` The value used to indicate infinite duration (e.g. when Animators repeat infinitely). <br /> | ||
| From class `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator` |---|---| | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#INFINITE:kotlin.Int` This value used used with the `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#setRepeatCount(kotlin.Int)` property to repeat the animation indefinitely. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#RESTART:kotlin.Int` When the animation reaches the end and `repeatCount` is INFINITE or a positive value, the animation restarts from the beginning. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#REVERSE:kotlin.Int` When the animation reaches the end and `repeatCount` is INFINITE or a positive value, the animation reverses direction on every iteration. <br /> | ||

| Public constructors ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/animation/TimeAnimator#TimeAnimator()()` <br /> |

| Public methods ||
|---|---|
| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/animation/TimeAnimator#setCurrentPlayTime(kotlin.Long)(playTime: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)` Sets the position of the animation to the specified point in time. |
| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/animation/TimeAnimator#setTimeListener(android.animation.TimeAnimator.TimeListener)(listener: https://developer.android.com/reference/kotlin/android/animation/TimeAnimator.TimeListener!)` Sets a listener that is sent update events throughout the life of an animation. |
| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `https://developer.android.com/reference/kotlin/android/animation/TimeAnimator#start()()` Starts this animation. |

| Inherited functions ||
|---|---|
| From class `https://developer.android.com/reference/kotlin/android/animation/Animator` |---|---| | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/animation/Animator#addListener(android.animation.Animator.AnimatorListener)(listener: https://developer.android.com/reference/kotlin/android/animation/Animator.AnimatorListener!)` Adds a listener to the set of listeners that are sent events through the life of an animation, such as start, repeat, and end. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/animation/Animator#addPauseListener(android.animation.Animator.AnimatorPauseListener)(listener: https://developer.android.com/reference/kotlin/android/animation/Animator.AnimatorPauseListener!)` Adds a pause listener to this animator. <br /> | | `https://developer.android.com/reference/kotlin/java/util/ArrayList.html#<https://developer.android.com/reference/kotlin/android/animation/Animator.AnimatorListener!>!` | `https://developer.android.com/reference/kotlin/android/animation/Animator#getListeners()()` Gets the set of `https://developer.android.com/reference/kotlin/android/animation/Animator.AnimatorListener` objects that are currently listening for events on this `Animator` object. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/android/animation/Animator#isPaused()()` Returns whether this animator is currently in a paused state. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/animation/Animator#removeAllListeners()()` Removes all `https://developer.android.com/reference/kotlin/android/animation/Animator#addListener(android.animation.Animator.AnimatorListener)` and `https://developer.android.com/reference/kotlin/android/animation/Animator#addPauseListener(android.animation.Animator.AnimatorPauseListener)` from this object. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/animation/Animator#removeListener(android.animation.Animator.AnimatorListener)(listener: https://developer.android.com/reference/kotlin/android/animation/Animator.AnimatorListener!)` Removes a listener from the set listening to this animation. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/animation/Animator#removePauseListener(android.animation.Animator.AnimatorPauseListener)(listener: https://developer.android.com/reference/kotlin/android/animation/Animator.AnimatorPauseListener!)` Removes a pause listener from the set listening to this animation. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/animation/Animator#setTarget(kotlin.Any)(target: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?)` Sets the target object whose property will be animated by this animation. Not all subclasses operate on target objects (for example, `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator`, but this method is on the superclass for the convenience of dealing generically with those subclasses that do handle targets. **Note:** The target is stored as a weak reference internally to avoid leaking resources by having animators directly reference old targets. Therefore, you should ensure that animator targets always have a hard reference elsewhere. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/animation/Animator#setupEndValues()()` This method tells the object to use appropriate information to extract ending values for the animation. For example, a AnimatorSet object will pass this call to its child objects to tell them to set up the values. A ObjectAnimator object will use the information it has about its target object and PropertyValuesHolder objects to get the start values for its properties. A ValueAnimator object will ignore the request since it does not have enough information (such as a target object) to gather these values. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/animation/Animator#setupStartValues()()` This method tells the object to use appropriate information to extract starting values for the animation. For example, a AnimatorSet object will pass this call to its child objects to tell them to set up the values. A ObjectAnimator object will use the information it has about its target object and PropertyValuesHolder objects to get the start values for its properties. A ValueAnimator object will ignore the request since it does not have enough information (such as a target object) to gather these values. <br /> | ||
| From class `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator` |---|---| | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#addUpdateListener(android.animation.ValueAnimator.AnimatorUpdateListener)(listener: https://developer.android.com/reference/kotlin/android/animation/ValueAnimator.AnimatorUpdateListener!)` Adds a listener to the set of listeners that are sent update events through the life of an animation. This method is called on all listeners for every frame of the animation, after the values for the animation have been calculated. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#areAnimatorsEnabled()()` Returns whether animators are currently enabled, system-wide. By default, all animators are enabled. This can change if either the user sets a Developer Option to set the animator duration scale to 0 or by Battery Savery mode being enabled (which disables all animations). Developers should not typically need to call this method, but should an app wish to show a different experience when animators are disabled, this return value can be used as a decider of which experience to offer. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#cancel()()` Cancels the animation. Unlike `https://developer.android.com/reference/kotlin/android/animation/Animator#end()`, `cancel()` causes the animation to stop in its tracks, sending an `https://developer.android.com/reference/kotlin/android/animation/Animator.AnimatorListener#onAnimationCancel(android.animation.Animator)` to its listeners, followed by an `https://developer.android.com/reference/kotlin/android/animation/Animator.AnimatorListener#onAnimationEnd(android.animation.Animator)` message. This method must be called on the thread that is running the animation. <br /> | | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#clone()()` Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object `x`, the expression: ```kotlin x.clone() != x ``` will be true, and that the expression: ```kotlin x.clone().getClass() == x.getClass() ``` will be `true`, but these are not absolute requirements. While it is typically the case that: ```kotlin x.clone().equals(x) ``` will be `true`, this is not an absolute requirement. <br /> By convention, the returned object should be obtained by calling `super.clone`. If a class and all of its superclasses (except `Object`) obey this convention, it will be the case that `x.clone().getClass() == x.getClass()`. By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by `super.clone` before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by `super.clone` need to be modified. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#end()()` Ends the animation. This causes the animation to assign the end value of the property being animated, then calling the `https://developer.android.com/reference/kotlin/android/animation/Animator.AnimatorListener#onAnimationEnd(android.animation.Animator)` method on its listeners. This method must be called on the thread that is running the animation. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#getAnimatedFraction()()` Returns the current animation fraction, which is the elapsed/interpolated fraction used in the most recent frame update on the animation. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html!` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#getAnimatedValue()()` The most recent value calculated by this `ValueAnimator` when there is just one property being animated. This value is only sensible while the animation is running. The main purpose for this read-only property is to retrieve the value from the `ValueAnimator` during a call to `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator.AnimatorUpdateListener#onAnimationUpdate(android.animation.ValueAnimator)`, which is called during each animation frame, immediately after the value is calculated. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html!` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#getAnimatedValue(kotlin.String)(propertyName: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html!)` The most recent value calculated by this `ValueAnimator` for `propertyName`. The main purpose for this read-only property is to retrieve the value from the `ValueAnimator` during a call to `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator.AnimatorUpdateListener#onAnimationUpdate(android.animation.ValueAnimator)`, which is called during each animation frame, immediately after the value is calculated. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#getCurrentPlayTime()()` Gets the current position of the animation in time, which is equal to the current time minus the time that the animation started. An animation that is not yet started will return a value of zero, unless the animation has has its play time set via `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#setCurrentPlayTime(kotlin.Long)` or `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#setCurrentFraction(kotlin.Float)`, in which case it will return the time that was set. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#getDuration()()` Gets the length of the animation. The default duration is 300 milliseconds. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#getDurationScale()()` Returns the system-wide scaling factor for Animator-based animations. This affects both the start delay and duration of all such animations. Setting to 0 will cause animations to end immediately. The default value is 1.0f. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#getFrameDelay()()` The amount of time, in milliseconds, between each frame of the animation. This is a requested time that the animation will attempt to honor, but the actual delay between frames may be different, depending on system load and capabilities. This is a static function because the same delay will be applied to all animations, since they are all run off of a single timing loop. The frame delay may be ignored when the animation system uses an external timing source, such as the display refresh rate (vsync), to govern animations. Note that this method should be called from the same thread that `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#start()` is called in order to check the frame delay for that animation. A runtime exception will be thrown if the calling thread does not have a Looper. <br /> | | `https://developer.android.com/reference/kotlin/android/animation/TimeInterpolator!` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#getInterpolator()()` Returns the timing interpolator that this ValueAnimator uses. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#getRepeatCount()()` Defines how many times the animation should repeat. The default value is 0. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#getRepeatMode()()` Defines what this animation should do when it reaches the end. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#getStartDelay()()` The amount of time, in milliseconds, to delay starting the animation after `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#start()` is called. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#getTotalDuration()()` Gets the total duration of the animation, accounting for animation sequences, start delay, and repeating. Return `https://developer.android.com/reference/kotlin/android/animation/Animator#DURATION_INFINITE:kotlin.Long` if the duration is infinite. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/android/animation/PropertyValuesHolder!>!` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#getValues()()` Returns the values that this ValueAnimator animates between. These values are stored in PropertyValuesHolder objects, even if the ValueAnimator was created with a simple list of value objects instead. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#isRunning()()` Returns whether this Animator is currently running (having been started and gone past any initial startDelay period and not yet ended). <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#isStarted()()` Returns whether this Animator has been started and not yet ended. For reusable Animators (which most Animators are, apart from the one-shot animator produced by `https://developer.android.com/reference/kotlin/android/view/ViewAnimationUtils.html#createCircularReveal(android.view.View,%20kotlin.Int,%20kotlin.Int,%20kotlin.Float,%20kotlin.Float)`), this state is a superset of `https://developer.android.com/reference/kotlin/android/animation/Animator#isRunning()`, because an Animator with a nonzero `https://developer.android.com/reference/kotlin/android/animation/Animator#getStartDelay()` will return true for `https://developer.android.com/reference/kotlin/android/animation/Animator#isStarted()` during the delay phase, whereas `https://developer.android.com/reference/kotlin/android/animation/Animator#isRunning()` will return true only after the delay phase is complete. Non-reusable animators will always return true after they have been started, because they cannot return to a non-started state. <br /> | | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator!` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#ofArgb(kotlin.Int)(vararg values: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Constructs and returns a ValueAnimator that animates between color values. A single value implies that that value is the one being animated to. However, this is not typically useful in a ValueAnimator object because there is no way for the object to determine the starting value for the animation (unlike ObjectAnimator, which can derive that value from the target object and property being animated). Therefore, there should typically be two or more values. <br /> | | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator!` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#ofFloat(kotlin.Float)(vararg values: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)` Constructs and returns a ValueAnimator that animates between float values. A single value implies that that value is the one being animated to. However, this is not typically useful in a ValueAnimator object because there is no way for the object to determine the starting value for the animation (unlike ObjectAnimator, which can derive that value from the target object and property being animated). Therefore, there should typically be two or more values. <br /> | | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator!` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#ofInt(kotlin.Int)(vararg values: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Constructs and returns a ValueAnimator that animates between int values. A single value implies that that value is the one being animated to. However, this is not typically useful in a ValueAnimator object because there is no way for the object to determine the starting value for the animation (unlike ObjectAnimator, which can derive that value from the target object and property being animated). Therefore, there should typically be two or more values. <br /> | | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator!` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#ofObject(android.animation.TypeEvaluator,%20kotlin.Any)(evaluator: https://developer.android.com/reference/kotlin/android/animation/TypeEvaluator<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html!>!, vararg values: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html!)` Constructs and returns a ValueAnimator that animates between Object values. A single value implies that that value is the one being animated to. However, this is not typically useful in a ValueAnimator object because there is no way for the object to determine the starting value for the animation (unlike ObjectAnimator, which can derive that value from the target object and property being animated). Therefore, there should typically be two or more values. **Note:** The Object values are stored as references to the original objects, which means that changes to those objects after this method is called will affect the values on the animator. If the objects will be mutated externally after this method is called, callers should pass a copy of those objects instead. Since ValueAnimator does not know how to animate between arbitrary Objects, this factory method also takes a TypeEvaluator object that the ValueAnimator will use to perform that interpolation. <br /> | | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator!` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#ofPropertyValuesHolder(android.animation.PropertyValuesHolder)(vararg values: https://developer.android.com/reference/kotlin/android/animation/PropertyValuesHolder!)` Constructs and returns a ValueAnimator that animates between the values specified in the PropertyValuesHolder objects. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#pause()()` Pauses a running animation. This method should only be called on the same thread on which the animation was started. If the animation has not yet been `https://developer.android.com/reference/kotlin/android/animation/Animator#isStarted()` or has since ended, then the call is ignored. Paused animations can be resumed by calling `https://developer.android.com/reference/kotlin/android/animation/Animator#resume()`. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#registerDurationScaleChangeListener(android.animation.ValueAnimator.DurationScaleChangeListener)(listener: https://developer.android.com/reference/kotlin/android/animation/ValueAnimator.DurationScaleChangeListener)` Registers a `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator.DurationScaleChangeListener` This listens for changes to the system-wide scaling factor for Animator-based animations. Listeners will be called on the main thread. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#removeAllUpdateListeners()()` Removes all listeners from the set listening to frame updates for this animation. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#removeUpdateListener(android.animation.ValueAnimator.AnimatorUpdateListener)(listener: https://developer.android.com/reference/kotlin/android/animation/ValueAnimator.AnimatorUpdateListener!)` Removes a listener from the set listening to frame updates for this animation. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#resume()()` Resumes a paused animation, causing the animator to pick up where it left off when it was paused. This method should only be called on the same thread on which the animation was started. Calls to resume() on an animator that is not currently paused will be ignored. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#reverse()()` Plays the ValueAnimator in reverse. If the animation is already running, it will stop itself and play backwards from the point reached when reverse was called. If the animation is not currently running, then it will start from the end and play backwards. This behavior is only set for the current animation; future playing of the animation will use the default behavior of playing forward. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#setCurrentFraction(kotlin.Float)(fraction: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)` Sets the position of the animation to the specified fraction. This fraction should be between 0 and the total fraction of the animation, including any repetition. That is, a fraction of 0 will position the animation at the beginning, a value of 1 at the end, and a value of 2 at the end of a reversing animator that repeats once. If the animation has not yet been started, then it will not advance forward after it is set to this fraction; it will simply set the fraction to this value and perform any appropriate actions based on that fraction. If the animation is already running, then setCurrentFraction() will set the current fraction to this value and continue playing from that point. `https://developer.android.com/reference/kotlin/android/animation/Animator.AnimatorListener` events are not called due to changing the fraction; those events are only processed while the animation is running. <br /> | | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator!` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#setDuration(kotlin.Long)(duration: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)` Sets the length of the animation. The default duration is 300 milliseconds. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#setEvaluator(android.animation.TypeEvaluator)(value: https://developer.android.com/reference/kotlin/android/animation/TypeEvaluator<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html!>!)` The type evaluator to be used when calculating the animated values of this animation. The system will automatically assign a float or int evaluator based on the type of `startValue` and `endValue` in the constructor. But if these values are not one of these primitive types, or if different evaluation is desired (such as is necessary with int values that represent colors), a custom evaluator needs to be assigned. For example, when running an animation on color values, the `https://developer.android.com/reference/kotlin/android/animation/ArgbEvaluator` should be used to get correct RGB color interpolation. If this ValueAnimator has only one set of values being animated between, this evaluator will be used for that set. If there are several sets of values being animated, which is the case if PropertyValuesHolder objects were set on the ValueAnimator, then the evaluator is assigned just to the first PropertyValuesHolder object. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#setFloatValues(kotlin.Float)(vararg values: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)` Sets float values that will be animated between. A single value implies that that value is the one being animated to. However, this is not typically useful in a ValueAnimator object because there is no way for the object to determine the starting value for the animation (unlike ObjectAnimator, which can derive that value from the target object and property being animated). Therefore, there should typically be two or more values. If there are already multiple sets of values defined for this ValueAnimator via more than one PropertyValuesHolder object, this method will set the values for the first of those objects. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#setFrameDelay(kotlin.Long)(frameDelay: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)` The amount of time, in milliseconds, between each frame of the animation. This is a requested time that the animation will attempt to honor, but the actual delay between frames may be different, depending on system load and capabilities. This is a static function because the same delay will be applied to all animations, since they are all run off of a single timing loop. The frame delay may be ignored when the animation system uses an external timing source, such as the display refresh rate (vsync), to govern animations. Note that this method should be called from the same thread that `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#start()` is called in order to have the new frame delay take effect on that animation. A runtime exception will be thrown if the calling thread does not have a Looper. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#setIntValues(kotlin.Int)(vararg values: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Sets int values that will be animated between. A single value implies that that value is the one being animated to. However, this is not typically useful in a ValueAnimator object because there is no way for the object to determine the starting value for the animation (unlike ObjectAnimator, which can derive that value from the target object and property being animated). Therefore, there should typically be two or more values. If there are already multiple sets of values defined for this ValueAnimator via more than one PropertyValuesHolder object, this method will set the values for the first of those objects. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#setInterpolator(android.animation.TimeInterpolator)(value: https://developer.android.com/reference/kotlin/android/animation/TimeInterpolator!)` The time interpolator used in calculating the elapsed fraction of this animation. The interpolator determines whether the animation runs with linear or non-linear motion, such as acceleration and deceleration. The default value is `https://developer.android.com/reference/kotlin/android/view/animation/AccelerateDecelerateInterpolator.html#` <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#setObjectValues(kotlin.Any)(vararg values: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html!)` Sets the values to animate between for this animation. A single value implies that that value is the one being animated to. However, this is not typically useful in a ValueAnimator object because there is no way for the object to determine the starting value for the animation (unlike ObjectAnimator, which can derive that value from the target object and property being animated). Therefore, there should typically be two or more values. **Note:** The Object values are stored as references to the original objects, which means that changes to those objects after this method is called will affect the values on the animator. If the objects will be mutated externally after this method is called, callers should pass a copy of those objects instead. If there are already multiple sets of values defined for this ValueAnimator via more than one PropertyValuesHolder object, this method will set the values for the first of those objects. There should be a TypeEvaluator set on the ValueAnimator that knows how to interpolate between these value objects. ValueAnimator only knows how to interpolate between the primitive types specified in the other setValues() methods. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#setRepeatCount(kotlin.Int)(value: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Sets how many times the animation should be repeated. If the repeat count is 0, the animation is never repeated. If the repeat count is greater than 0 or `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#INFINITE:kotlin.Int`, the repeat mode will be taken into account. The repeat count is 0 by default. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#setRepeatMode(kotlin.Int)(value: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Defines what this animation should do when it reaches the end. This setting is applied only when the repeat count is either greater than 0 or `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#INFINITE:kotlin.Int`. Defaults to `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#RESTART:kotlin.Int`. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#setStartDelay(kotlin.Long)(startDelay: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)` The amount of time, in milliseconds, to delay starting the animation after `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#start()` is called. Note that the start delay should always be non-negative. Any negative start delay will be clamped to 0 on N and above. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#setValues(android.animation.PropertyValuesHolder)(vararg values: https://developer.android.com/reference/kotlin/android/animation/PropertyValuesHolder!)` Sets the values, per property, being animated between. This function is called internally by the constructors of ValueAnimator that take a list of values. But a ValueAnimator can be constructed without values and this method can be called to set the values manually instead. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#toString()()` Returns a string representation of the object. <br /> | | `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/android/animation/ValueAnimator#unregisterDurationScaleChangeListener(android.animation.ValueAnimator.DurationScaleChangeListener)(listener: https://developer.android.com/reference/kotlin/android/animation/ValueAnimator.DurationScaleChangeListener)` Unregisters a DurationScaleChangeListener. <br /> | ||

## Public constructors

### TimeAnimator

```
TimeAnimator()
```

## Public methods

### setCurrentPlayTime

Added in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open fun setCurrentPlayTime(playTime: Long): Unit
```

Sets the position of the animation to the specified point in time. This time should be between 0 and the total duration of the animation, including any repetition. If the animation has not yet been started, then it will not advance forward after it is set to this time; it will simply set the time to this value and perform any appropriate actions based on that time. If the animation is already running, then setCurrentPlayTime() will set the current playing time to this value and continue playing from that point.

| Parameters ||
|---|---|
| `playTime` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html): The time, in milliseconds, to which the animation is advanced or rewound. |

### setTimeListener

Added in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open fun setTimeListener(listener: TimeAnimator.TimeListener!): Unit
```

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

| Parameters ||
|---|---|
| `listener` | [TimeAnimator.TimeListener](https://developer.android.com/reference/kotlin/android/animation/TimeAnimator.TimeListener)!: the listener to be set. |

### start

Added in [API level 16](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
open fun start(): Unit
```

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 `https://developer.android.com/reference/kotlin/android/animation/Animator.AnimatorListener#onAnimationStart(android.animation.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.