# AnimatorSet

# AnimatorSet

Artifact:[androidx.core:core-animation](https://developer.android.com/jetpack/androidx/releases/core)  
[View Source](https://cs.android.com/search?q=file:androidx/core/animation/AnimatorSet.java+class:androidx.core.animation.AnimatorSet)

*** ** * ** ***

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

<br />

```
class AnimatorSet : Animator
```

<br />

|---|---|---------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)                                              |||
| ↳ | [androidx.core.animation.Animator](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator)          ||
|   | ↳ | [androidx.core.animation.AnimatorSet](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet) |

*** ** * ** ***

This class plays a set of[Animator](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator)objects in the specified order. Animations can be set up to play together, in sequence, or after a specified delay.

There are two different approaches to adding animations to a`AnimatorSet`: either the[playTogether()](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#playTogether(androidx.core.animation.Animator...))or[playSequentially()](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#playSequentially(androidx.core.animation.Animator...))methods can be called to add a set of animations all at once, or the[play](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#play(androidx.core.animation.Animator))can be used in conjunction with methods in the[Builder](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet.Builder)class to add animations one by one.

It is possible to set up a`AnimatorSet`with circular dependencies between its animations. For example, an animation a1 could be set up to start before animation a2, a2 before a3, and a3 before a1. The results of this configuration are undefined, but will typically result in none of the affected animations being played. Because of this (and because circular dependencies do not make logical sense anyway), circular dependencies should be avoided, and the dependency flow of animations should only be in one direction.

## Summary

|                                                                                                                                  ### Nested types                                                                                                                                   |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `inner class `[AnimatorSet.Builder](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet.Builder) The`Builder`object is a utility class to facilitate adding animations to a`AnimatorSet`along with the relationships between the various animations. |

|                                               ### Public constructors                                               |
|---------------------------------------------------------------------------------------------------------------------|
| [AnimatorSet](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#AnimatorSet())`()` |

|                                                                              ### Public functions                                                                               |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                             | [canReverse](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#canReverse())`()` AnimatorSet is only reversible when the set contains no infinitely-repeating animation (e.g. a child animation with repeatCount =[INFINITE](https://developer.android.com/reference/kotlin/androidx/core/animation/ValueAnimator#INFINITE())                                                                                                                                                                                                                             |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                   | [cancel](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#cancel())`()` Cancels the animation.                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| [AnimatorSet](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet)                                                                               | [clone](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#clone())`()`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                   | [end](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#end())`()` Ends the animation.                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| [ArrayList](https://developer.android.com/reference/java/util/ArrayList.html)`<`[Animator](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator)`!>` | [getChildAnimations](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#getChildAnimations())`()` Returns the current list of child Animator objects controlled by this AnimatorSet.                                                                                                                                                                                                                                                                                                                                                                       |
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                                                                                                   | [getCurrentPlayTime](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#getCurrentPlayTime())`()` Returns the milliseconds elapsed since the start of the animation.                                                                                                                                                                                                                                                                                                                                                                                       |
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                                                                                                   | [getDuration](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#getDuration())`()` Gets the length of each of the child animations of this AnimatorSet.                                                                                                                                                                                                                                                                                                                                                                                                   |
| [Interpolator](https://developer.android.com/reference/kotlin/androidx/core/animation/Interpolator)`?`                                                                          | [getInterpolator](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#getInterpolator())`()` Returns the timing interpolator that this animation uses.                                                                                                                                                                                                                                                                                                                                                                                                      |
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                                                                                                   | [getStartDelay](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#getStartDelay())`()` The amount of time, in milliseconds, to delay starting the animation after[start](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#start())is called.                                                                                                                                                                                                                                                                            |
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                                                                                                   | [getTotalDuration](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#getTotalDuration())`()` Gets the total duration of the animation, accounting for animation sequences, start delay, and repeating.                                                                                                                                                                                                                                                                                                                                                    |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                             | [isRunning](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#isRunning())`()` Returns true if any of the child animations of this AnimatorSet have been started and have not yet ended.                                                                                                                                                                                                                                                                                                                                                                  |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                             | [isStarted](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#isStarted())`()` Returns whether this Animator has been started and not yet ended.                                                                                                                                                                                                                                                                                                                                                                                                          |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                   | [pause](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#pause())`()` Pauses a running animation.                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| [AnimatorSet.Builder](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet.Builder)                                                               | [play](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#play(androidx.core.animation.Animator))`(anim: `[Animator](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator)`)` This method creates a`Builder`object, which is used to set up playing constraints.                                                                                                                                                                                                                                                                |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                   | [playSequentially](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#playSequentially(androidx.core.animation.Animator...))`(items: `[Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)`<`[Animator](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator)`!>)` Sets up this AnimatorSet to play each of the supplied animations when the previous animation ends.                                                                                                                                |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                   | [playSequentially](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#playSequentially(java.util.List<androidx.core.animation.Animator>))`(items: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[Animator](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator)`!>)` Sets up this AnimatorSet to play each of the supplied animations when the previous animation ends. |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                   | [playTogether](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#playTogether(androidx.core.animation.Animator...))`(items: `[Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)`<`[Animator](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator)`!>)` Sets up this AnimatorSet to play all of the supplied animations at the same time.                                                                                                                                                         |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                   | [playTogether](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#playTogether(java.util.Collection<androidx.core.animation.Animator>))`(items: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-collection/index.html)`)`[Collection](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-collection/index.html)`<`[Animator](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator)`!>)` Sets up this AnimatorSet to play all of the supplied animations at the same time.  |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                   | [resume](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#resume())`()` Resumes a paused animation, causing the animator to pick up where it left off when it was paused.                                                                                                                                                                                                                                                                                                                                                                                |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                   | [reverse](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#reverse())`()` Plays the AnimatorSet in reverse.                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                   | [setCurrentPlayTime](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#setCurrentPlayTime(long))`(playTime: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` Sets the position of the animation to the specified point in time.                                                                                                                                                                                                                                                                                          |
| [AnimatorSet](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet)                                                                               | [setDuration](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#setDuration(long))`(duration: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` Sets the length of each of the current child animations of this AnimatorSet.                                                                                                                                                                                                                                                                                              |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                   | [setInterpolator](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#setInterpolator(androidx.core.animation.Interpolator))`(interpolator: `[Interpolator](https://developer.android.com/reference/kotlin/androidx/core/animation/Interpolator)`?)` Sets the Interpolator for all current[child animations](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#getChildAnimations())of this AnimatorSet.                                                                                                                   |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                   | [setStartDelay](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#setStartDelay(long))`(startDelay: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` The amount of time, in milliseconds, to delay starting the animation after[start](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#start())is called.                                                                                                                                                                             |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                   | [setTarget](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#setTarget(java.lang.Object))`(target: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)` Sets the target object for all current[child animations](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#getChildAnimations())of this AnimatorSet that take targets ([ObjectAnimator](https://developer.android.com/reference/kotlin/androidx/core/animation/ObjectAnimator)and AnimatorSet).                                     |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                   | [setupEndValues](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#setupEndValues())`()` This method tells the object to use appropriate information to extract ending values for the animation.                                                                                                                                                                                                                                                                                                                                                          |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                   | [setupStartValues](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#setupStartValues())`()` This method tells the object to use appropriate information to extract starting values for the animation.                                                                                                                                                                                                                                                                                                                                                    |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                                                   | [start](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#start())`()` Starts this animation.                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!`                                                                                            | [toString](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#toString())`()`                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |

|                                                                                                                                                                                                                                                                                                                                                                   ### Inherited Constants                                                                                                                                                                                                                                                                                                                                                                   |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[androidx.core.animation.Animator](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator) |---------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `const `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | [DURATION_INFINITE](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator#DURATION_INFINITE())` = -1` The value used to indicate infinite duration (e.g. when Animators repeat infinitely). | |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       ### Inherited functions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[androidx.core.animation.Animator](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator) |-------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)       | [addListener](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator#addListener(androidx.core.animation.Animator.AnimatorListener))`(listener: `[Animator.AnimatorListener](https://developer.android.com/reference/kotlin/androidx/core/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.                                                           | | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)       | [addPauseListener](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator#addPauseListener(androidx.core.animation.Animator.AnimatorPauseListener))`(listener: `[Animator.AnimatorPauseListener](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator.AnimatorPauseListener)`)` Adds a pause listener to this animator.                                                                                                                         | | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)       | [addUpdateListener](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator#addUpdateListener(androidx.core.animation.Animator.AnimatorUpdateListener))`(listener: `[Animator.AnimatorUpdateListener](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator.AnimatorUpdateListener)`)` Adds a listener to the set of listeners that are sent update events through the life of an animation.                                                      | | [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [isPaused](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator#isPaused())`()` Returns whether this animator is currently in a paused state.                                                                                                                                                                                                                                                                                                                            | | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)       | [removeAllListeners](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator#removeAllListeners())`()` Removes all[listeners](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator#addListener(androidx.core.animation.Animator.AnimatorListener))and[pauseListeners](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator#addPauseListener(androidx.core.animation.Animator.AnimatorPauseListener))from this object. | | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)       | [removeAllUpdateListeners](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator#removeAllUpdateListeners())`()` Removes all listeners from the set listening to frame updates for this animation.                                                                                                                                                                                                                                                                        | | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)       | [removeListener](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator#removeListener(androidx.core.animation.Animator.AnimatorListener))`(listener: `[Animator.AnimatorListener](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator.AnimatorListener)`)` Removes a listener from the set listening to this animation.                                                                                                                       | | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)       | [removePauseListener](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator#removePauseListener(androidx.core.animation.Animator.AnimatorPauseListener))`(listener: `[Animator.AnimatorPauseListener](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator.AnimatorPauseListener)`)` Removes a pause listener from the set listening to this animation.                                                                                        | | [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)       | [removeUpdateListener](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator#removeUpdateListener(androidx.core.animation.Animator.AnimatorUpdateListener))`(listener: `[Animator.AnimatorUpdateListener](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator.AnimatorUpdateListener)`)` Removes a listener from the set listening to frame updates for this animation.                                                                       | |

## Public constructors

### AnimatorSet

```
AnimatorSet()
```  

## Public functions

### canReverse

```
fun canReverse(): Boolean
```

AnimatorSet is only reversible when the set contains no infinitely-repeating animation (e.g. a child animation with repeatCount =[INFINITE](https://developer.android.com/reference/kotlin/androidx/core/animation/ValueAnimator#INFINITE())  

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|----------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | true if the animator set is reversible, false otherwise. |

### cancel

```
fun cancel(): Unit
```

Cancels the animation. Unlike #end(),`cancel()`causes the animation to stop in its tracks, sending an AnimatorListener#onAnimationCancel(Animator) to its listeners, followed by an AnimatorListener#onAnimationEnd(Animator) message.

This method must be called on the thread that is running the animation.

Note that canceling a`AnimatorSet`also cancels all of the animations that it is responsible for.  

### clone

```
fun clone(): AnimatorSet
```  

### end

```
fun end(): Unit
```

Ends the animation. This causes the animation to assign the end value of the property being animated, then calling the AnimatorListener#onAnimationEnd(Animator) method on its listeners.

This method must be called on the thread that is running the animation.

Note that ending a`AnimatorSet`also ends all of the animations that it is responsible for.  

### getChildAnimations

```
fun getChildAnimations(): ArrayList<Animator!>
```

Returns the current list of child Animator objects controlled by this AnimatorSet. This is a copy of the internal list; modifications to the returned list will not affect the AnimatorSet, although changes to the underlying Animator objects will affect those objects being managed by the AnimatorSet.  

|                                                                                     Returns                                                                                     |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------|
| [ArrayList](https://developer.android.com/reference/java/util/ArrayList.html)`<`[Animator](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator)`!>` | ArrayListThe list of child animations of this AnimatorSet. |

### getCurrentPlayTime

```
fun getCurrentPlayTime(): Long
```

Returns the milliseconds elapsed since the start of the animation.

For ongoing animations, this method returns the current progress of the animation in terms of play time. For an animation that has not yet been started: if the animation has been seeked to a certain time via[setCurrentPlayTime](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#setCurrentPlayTime(long)), the seeked play time will be returned; otherwise, this method will return 0.  

|                                    Returns                                    |
|-------------------------------------------------------------------------------|---------------------------------------------------------------|
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | the current position in time of the animation in milliseconds |

### getDuration

```
fun getDuration(): Long
```

Gets the length of each of the child animations of this AnimatorSet. This value may be less than 0, which indicates that no duration has been set on this AnimatorSet and each of the child animations will use their own duration.  

|                                    Returns                                    |
|-------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | The length of the animation, in milliseconds, of each of the child animations of this AnimatorSet. |

### getInterpolator

```
fun getInterpolator(): Interpolator?
```

Returns the timing interpolator that this animation uses.  

|                                                Returns                                                 |
|--------------------------------------------------------------------------------------------------------|---------------------------------------------|
| [Interpolator](https://developer.android.com/reference/kotlin/androidx/core/animation/Interpolator)`?` | The timing interpolator for this animation. |

### getStartDelay

```
fun getStartDelay(): Long
```

The amount of time, in milliseconds, to delay starting the animation after[start](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#start())is called.  

|                                    Returns                                    |
|-------------------------------------------------------------------------------|-----------------------------------------------------------|
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | the number of milliseconds to delay running the animation |

### getTotalDuration

```
fun getTotalDuration(): Long
```

Gets the total duration of the animation, accounting for animation sequences, start delay, and repeating.

When the animation repeats infinite times, or when any of the child animators does (via ValueAnimator#setRepeatCount(int)} to ValueAnimator#INFINITE), the total duration will be #DURATION_INFINITE. Otherwise, the total duration is the sum of start delay and animation running time (i.e. duration of one iteration multiplied by the number of iterations).  

### isRunning

```
fun isRunning(): Boolean
```

Returns true if any of the child animations of this AnimatorSet have been started and have not yet ended. Child animations will not be started until the AnimatorSet has gone past its initial delay set through[setStartDelay](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#setStartDelay(long)).  

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | Whether this AnimatorSet has gone past the initial delay, and at least one child animation has been started and not yet ended. |

### isStarted

```
fun isStarted(): Boolean
```

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[createCircularReveal()](https://developer.android.com/reference/android/view/ViewAnimationUtils.html#createCircularReveal(android.view.View, int, int, float, float))), this state is a superset of[isRunning](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator#isRunning()), because an Animator with a nonzero[startDelay](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator#getStartDelay())will return true for[isStarted](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator#isStarted())during the delay phase, whereas[isRunning](https://developer.android.com/reference/kotlin/androidx/core/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.  

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|----------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | Whether the Animator has been started and not yet ended. |

### pause

```
fun pause(): Unit
```

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[started](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator#isStarted())or has since ended, then the call is ignored. Paused animations can be resumed by calling[resume](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator#resume()).  

|                                                                See also                                                                 |
|-----------------------------------------------------------------------------------------------------------------------------------------|---|
| [resume](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator#resume())                                      |   |
| [isPaused](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator#isPaused())                                  |   |
| [Animator.AnimatorPauseListener](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator.AnimatorPauseListener) |   |

### play

```
fun play(anim: Animator): AnimatorSet.Builder
```

This method creates a`Builder`object, which is used to set up playing constraints. This initial`play()`method tells the`Builder`the animation that is the dependency for the succeeding commands to the`Builder`. For example, calling`play(a1).with(a2)`sets up the AnimatorSet to play`a1`and`a2`at the same time,`play(a1).before(a2)`sets up the AnimatorSet to play`a1`first, followed by`a2`, and`play(a1).after(a2)`sets up the AnimatorSet to play`a2`first, followed by`a1`.

Note that`play()`is the only way to tell the`Builder`the animation upon which the dependency is created, so successive calls to the various functions in`Builder`will all refer to the initial parameter supplied in`play()`as the dependency of the other animations. For example, calling`play(a1).before(a2).before(a3)`will play both`a2`and`a3`when a1 ends; it does not set up a dependency between`a2`and`a3`.  

|                                             Parameters                                              |
|-----------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `anim: `[Animator](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator) | The animation that is the dependency used in later calls to the methods in the returned`Builder`object. A null parameter will result in a null`Builder`return value. |

|                                                      Returns                                                      |
|-------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
| [AnimatorSet.Builder](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet.Builder) | Builder The object that constructs the AnimatorSet based on the dependencies outlined in the calls to`play`and the other methods in the`Builder` |

### playSequentially

```
fun playSequentially(items: Array<Animator!>): Unit
```

Sets up this AnimatorSet to play each of the supplied animations when the previous animation ends.  

|                                                                                         Parameters                                                                                         |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------|
| `items: `[Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)`<`[Animator](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator)`!>` | The animations that will be started one after another. |

### playSequentially

```
fun playSequentially(items: (Mutable)List<Animator!>): Unit
```

Sets up this AnimatorSet to play each of the supplied animations when the previous animation ends.  

|                                                                                                                                                  Parameters                                                                                                                                                  |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------|
| `items: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)`)`[List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)`<`[Animator](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator)`!>` | The animations that will be started one after another. |

### playTogether

```
fun playTogether(items: Array<Animator!>): Unit
```

Sets up this AnimatorSet to play all of the supplied animations at the same time. This is equivalent to calling[play](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#play(androidx.core.animation.Animator))with the first animator in the set and then[with](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet.Builder#with(androidx.core.animation.Animator))with each of the other animators. Note that an Animator with a[startDelay](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator#setStartDelay(long))will not actually start until that delay elapses, which means that if the first animator in the list supplied to this constructor has a startDelay, none of the other animators will start until that first animator's startDelay has elapsed.  

|                                                                                         Parameters                                                                                         |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|
| `items: `[Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)`<`[Animator](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator)`!>` | The animations that will be started simultaneously. |

### playTogether

```
fun playTogether(items: (Mutable)Collection<Animator!>): Unit
```

Sets up this AnimatorSet to play all of the supplied animations at the same time.  

|                                                                                                                                                           Parameters                                                                                                                                                           |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------|
| `items: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-collection/index.html)`)`[Collection](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-collection/index.html)`<`[Animator](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator)`!>` | The animations that will be started simultaneously. |

### resume

```
fun resume(): Unit
```

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.  

|                                                                See also                                                                 |
|-----------------------------------------------------------------------------------------------------------------------------------------|---|
| [pause](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator#pause())                                        |   |
| [isPaused](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator#isPaused())                                  |   |
| [Animator.AnimatorPauseListener](https://developer.android.com/reference/kotlin/androidx/core/animation/Animator.AnimatorPauseListener) |   |

### reverse

```
fun reverse(): Unit
```

Plays the AnimatorSet in reverse. If the animation has been seeked to a specific play time using[setCurrentPlayTime](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#setCurrentPlayTime(long)), it will play backwards from the point seeked when reverse was called. Otherwise, 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.

Note: reverse is not supported for infinite AnimatorSet.  

### setCurrentPlayTime

```
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/core/kotlin-stdlib/kotlin/-long/index.html) | The time, in milliseconds, to which the animation is advanced or rewound. Unless the animation is reversing, the playtime is considered the time since the end of the start delay of the AnimatorSet in a forward playing direction. |

### setDuration

```
fun setDuration(duration: Long): AnimatorSet
```

Sets the length of each of the current child animations of this AnimatorSet. By default, each child animation will use its own duration. If the duration is set on the AnimatorSet, then each child animation inherits this duration.  

|                                        Parameters                                         |
|-------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|
| `duration: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | The length of the animation, in milliseconds, of each of the child animations of this AnimatorSet. |

### setInterpolator

```
fun setInterpolator(interpolator: Interpolator?): Unit
```

Sets the Interpolator for all current[child animations](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#getChildAnimations())of this AnimatorSet. The default value is null, which means that no interpolator is set on this AnimatorSet. Setting the interpolator to any non-null value will cause that interpolator to be set on the child animations when the set is started.  

|                                                       Parameters                                                       |
|------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------|
| `interpolator: `[Interpolator](https://developer.android.com/reference/kotlin/androidx/core/animation/Interpolator)`?` | the interpolator to be used by each child animation of this AnimatorSet |

### setStartDelay

```
fun setStartDelay(startDelay: Long): Unit
```

The amount of time, in milliseconds, to delay starting the animation after[start](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#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.  

|                                         Parameters                                          |
|---------------------------------------------------------------------------------------------|------------------------------------------|
| `startDelay: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | The amount of the delay, in milliseconds |

### setTarget

```
fun setTarget(target: Any?): Unit
```

Sets the target object for all current[child animations](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#getChildAnimations())of this AnimatorSet that take targets ([ObjectAnimator](https://developer.android.com/reference/kotlin/androidx/core/animation/ObjectAnimator)and AnimatorSet).  

|                                        Parameters                                        |
|------------------------------------------------------------------------------------------|---------------------------|
| `target: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?` | The object being animated |

### setupEndValues

```
fun setupEndValues(): Unit
```

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.  

### setupStartValues

```
fun setupStartValues(): Unit
```

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.  

### start

```
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 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.

Starting this`AnimatorSet`will, in turn, start the animations for which it is responsible. The details of when exactly those animations are started depends on the dependency relationships that have been set up between the animations.**Note:** Manipulating AnimatorSet's lifecycle in the child animators' listener callbacks will lead to undefined behaviors. Also, AnimatorSet will ignore any seeking in the child animators once[start](https://developer.android.com/reference/kotlin/androidx/core/animation/AnimatorSet#start())is called.  

### toString

```
fun toString(): String!
```