Google is committed to advancing racial equity for Black communities. See how.

AnimatorListener

interface AnimatorListener
androidx.core.animation.Animator.AnimatorListener

An animation listener receives notifications from an animation. Notifications indicate animation related events, such as the end or the repetition of the animation.

Summary

Public methods
abstract Unit
onAnimationCancel(@NonNull animation: Animator)

Notifies the cancellation of the animation.

open Unit
onAnimationEnd(@NonNull animation: Animator, isReverse: Boolean)

Notifies the end of the animation.

abstract Unit
onAnimationEnd(@NonNull animation: Animator)

Notifies the end of the animation.

abstract Unit
onAnimationRepeat(@NonNull animation: Animator)

Notifies the repetition of the animation.

open Unit
onAnimationStart(@NonNull animation: Animator, isReverse: Boolean)

Notifies the start of the animation as well as the animation's overall play direction.

abstract Unit
onAnimationStart(@NonNull animation: Animator)

Notifies the start of the animation.

Public methods

onAnimationCancel

abstract fun onAnimationCancel(@NonNull animation: Animator): Unit

Notifies the cancellation of the animation. This callback is not invoked for animations with repeat count set to INFINITE.

Parameters
animation Animator: The animation which was canceled.

onAnimationEnd

open fun onAnimationEnd(
    @NonNull animation: Animator,
    isReverse: Boolean
): Unit

Notifies the end of the animation. This callback is not invoked for animations with repeat count set to INFINITE.

This method's default behavior is to call onAnimationEnd(Animator). This method can be overridden, though not required, to get the additional play direction info when an animation ends. Skipping calling super when overriding this method results in onAnimationEnd(Animator) not getting called.

Parameters
animation Animator: The animation which reached its end.
isReverse Boolean: Whether the animation is playing in reverse.

onAnimationEnd

abstract fun onAnimationEnd(@NonNull animation: Animator): Unit

Notifies the end of the animation. This callback is not invoked for animations with repeat count set to INFINITE.

Parameters
animation Animator: The animation which reached its end.

onAnimationRepeat

abstract fun onAnimationRepeat(@NonNull animation: Animator): Unit

Notifies the repetition of the animation.

Parameters
animation Animator: The animation which was repeated

onAnimationStart

open fun onAnimationStart(
    @NonNull animation: Animator,
    isReverse: Boolean
): Unit

Notifies the start of the animation as well as the animation's overall play direction. This method's default behavior is to call onAnimationStart(Animator). This method can be overridden, though not required, to get the additional play direction info when an animation starts. Skipping calling super when overriding this method results in onAnimationStart(Animator) not getting called.

Parameters
animation Animator: The started animation.
isReverse Boolean: Whether the animation is playing in reverse.

onAnimationStart

abstract fun onAnimationStart(@NonNull animation: Animator): Unit

Notifies the start of the animation.

Parameters
animation Animator: The started animation.