AnimatorSet
class AnimatorSet : Animator, AnimationFrameCallback
kotlin.Any | ||
↳ | androidx.core.animation.Animator | |
↳ | androidx.core.animation.AnimatorSet |
This class plays a set of 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()
or playSequentially()
methods can be called to add a set of animations all at once, or the AnimatorSet#play(Animator)
can be used in conjunction with methods in the 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 classes | |
---|---|
The |
Inherited constants | |
---|---|
Public constructors | |
---|---|
<init>() |
Public methods | |
---|---|
Boolean |
AnimatorSet is only reversible when the set contains no infinitely-repeating animation (e.g. a child animation with repeatCount = |
Unit |
cancel() Cancels the animation. |
AnimatorSet |
clone() |
Unit |
end() Ends the animation. |
ArrayList<Animator!> |
Returns the current list of child Animator objects controlled by this AnimatorSet. |
Long |
Returns the milliseconds elapsed since the start of the animation. |
Long |
Gets the length of each of the child animations of this AnimatorSet. |
Interpolator? | |
Long |
The amount of time, in milliseconds, to delay starting the animation after |
Long |
Gets the total duration of the animation, accounting for animation sequences, start delay, and repeating. |
Boolean |
Returns true if any of the child animations of this AnimatorSet have been started and have not yet ended. |
Boolean | |
Unit |
pause() |
AnimatorSet.Builder |
This method creates a |
Unit |
playSequentially(@NonNull vararg items: Animator!) Sets up this AnimatorSet to play each of the supplied animations when the previous animation ends. |
Unit |
playSequentially(@NonNull items: MutableList<Animator!>) Sets up this AnimatorSet to play each of the supplied animations when the previous animation ends. |
Unit |
playTogether(@NonNull vararg items: Animator!) Sets up this AnimatorSet to play all of the supplied animations at the same time. |
Unit |
playTogether(@NonNull items: MutableCollection<Animator!>) Sets up this AnimatorSet to play all of the supplied animations at the same time. |
Unit |
resume() |
Unit |
reverse() Plays the AnimatorSet in reverse. |
Unit |
setCurrentPlayTime(playTime: Long) Sets the position of the animation to the specified point in time. |
AnimatorSet |
setDuration(duration: Long) Sets the length of each of the current child animations of this AnimatorSet. |
Unit |
setInterpolator(@Nullable interpolator: Interpolator?) Sets the Interpolator for all current |
Unit |
setStartDelay(startDelay: Long) The amount of time, in milliseconds, to delay starting the animation after |
Unit |
Sets the target object for all current |
Unit | |
Unit | |
Unit |
start() Starts this animation. |
String |
toString() |
Inherited functions | |
---|---|