core-ktx / androidx.animation / android.animation.Animator

Extensions for android.animation.Animator

addListener

fun Animator.addListener(onEnd: (animator: Animator) -> Unit = null, onStart: (animator: Animator) -> Unit = null, onCancel: (animator: Animator) -> Unit = null, onRepeat: (animator: Animator) -> Unit = null): AnimatorListener

Add a listener to this Animator using the provided actions.

addPauseListener

fun Animator.addPauseListener(onResume: (animator: Animator) -> Unit = null, onPause: (animator: Animator) -> Unit = null): AnimatorPauseListener

Add a pause and resume listener to this Animator using the provided actions.

doOnCancel

fun Animator.doOnCancel(action: (animator: Animator) -> Unit): AnimatorListener

Add an action which will be invoked when the animation has been cancelled.

doOnEnd

fun Animator.doOnEnd(action: (animator: Animator) -> Unit): AnimatorListener

Add an action which will be invoked when the animation has ended.

doOnPause

fun Animator.doOnPause(action: (animator: Animator) -> Unit): AnimatorPauseListener

Add an action which will be invoked when the animation has been paused.

doOnRepeat

fun Animator.doOnRepeat(action: (animator: Animator) -> Unit): AnimatorListener

Add an action which will be invoked when the animation has repeated.

doOnResume

fun Animator.doOnResume(action: (animator: Animator) -> Unit): AnimatorPauseListener

Add an action which will be invoked when the animation has resumed after a pause.

doOnStart

fun Animator.doOnStart(action: (animator: Animator) -> Unit): AnimatorListener

Add an action which will be invoked when the animation has started.