Added in API level 11

AnimatorListener


interface AnimatorListener
android.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

Notifies the cancellation of the animation.

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

Notifies the end of the animation.

abstract Unit

Notifies the end of the animation.

abstract Unit

Notifies the repetition of the animation.

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

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

abstract Unit

Notifies the start of the animation.

Public methods

onAnimationCancel

Added in API level 11
abstract fun onAnimationCancel(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. This value cannot be null.

onAnimationEnd

Added in API level 26
open fun onAnimationEnd(
    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(android.animation.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(android.animation.Animator) not getting called.

Parameters
animation Animator: The animation which reached its end. This value cannot be null.
isReverse Boolean: Whether the animation is playing in reverse.

onAnimationEnd

Added in API level 11
abstract fun onAnimationEnd(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. This value cannot be null.

onAnimationRepeat

Added in API level 11
abstract fun onAnimationRepeat(animation: Animator): Unit

Notifies the repetition of the animation.

Parameters
animation Animator: The animation which was repeated. This value cannot be null.

onAnimationStart

Added in API level 26
open fun onAnimationStart(
    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(android.animation.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(android.animation.Animator) not getting called.

Parameters
animation Animator: The started animation. This value cannot be null.
isReverse Boolean: Whether the animation is playing in reverse.

onAnimationStart

Added in API level 11
abstract fun onAnimationStart(animation: Animator): Unit

Notifies the start of the animation.

Parameters
animation Animator: The started animation. This value cannot be null.