AnimatorKt

Added in 1.1.0

public final class AnimatorKt


Summary

Public methods

static final @NonNull Animator.AnimatorListener
addListener(
    @NonNull Animator receiver,
    @NonNull Function1<@NonNull AnimatorUnit> onEnd,
    @NonNull Function1<@NonNull AnimatorUnit> onStart,
    @NonNull Function1<@NonNull AnimatorUnit> onCancel,
    @NonNull Function1<@NonNull AnimatorUnit> onRepeat
)

Add a listener to this Animator using the provided actions.

static final @NonNull Animator.AnimatorPauseListener
addPauseListener(
    @NonNull Animator receiver,
    @NonNull Function1<@NonNull AnimatorUnit> onResume,
    @NonNull Function1<@NonNull AnimatorUnit> onPause
)

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

static final @NonNull Animator.AnimatorListener
doOnCancel(
    @NonNull Animator receiver,
    @NonNull Function1<@NonNull AnimatorUnit> action
)

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

static final @NonNull Animator.AnimatorListener
doOnEnd(
    @NonNull Animator receiver,
    @NonNull Function1<@NonNull AnimatorUnit> action
)

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

static final @NonNull Animator.AnimatorPauseListener
doOnPause(
    @NonNull Animator receiver,
    @NonNull Function1<@NonNull AnimatorUnit> action
)

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

static final @NonNull Animator.AnimatorListener
doOnRepeat(
    @NonNull Animator receiver,
    @NonNull Function1<@NonNull AnimatorUnit> action
)

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

static final @NonNull Animator.AnimatorPauseListener
doOnResume(
    @NonNull Animator receiver,
    @NonNull Function1<@NonNull AnimatorUnit> action
)

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

static final @NonNull Animator.AnimatorListener
doOnStart(
    @NonNull Animator receiver,
    @NonNull Function1<@NonNull AnimatorUnit> action
)

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

Public methods

addListener

public static final @NonNull Animator.AnimatorListener addListener(
    @NonNull Animator receiver,
    @NonNull Function1<@NonNull AnimatorUnit> onEnd,
    @NonNull Function1<@NonNull AnimatorUnit> onStart,
    @NonNull Function1<@NonNull AnimatorUnit> onCancel,
    @NonNull Function1<@NonNull AnimatorUnit> onRepeat
)

Add a listener to this Animator using the provided actions.

Returns
@NonNull Animator.AnimatorListener

the Animator.AnimatorListener added to the Animator

addPauseListener

public static final @NonNull Animator.AnimatorPauseListener addPauseListener(
    @NonNull Animator receiver,
    @NonNull Function1<@NonNull AnimatorUnit> onResume,
    @NonNull Function1<@NonNull AnimatorUnit> onPause
)

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

doOnCancel

public static final @NonNull Animator.AnimatorListener doOnCancel(
    @NonNull Animator receiver,
    @NonNull Function1<@NonNull AnimatorUnit> action
)

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

Returns
@NonNull Animator.AnimatorListener

the Animator.AnimatorListener added to the Animator

See also
cancel

doOnEnd

public static final @NonNull Animator.AnimatorListener doOnEnd(
    @NonNull Animator receiver,
    @NonNull Function1<@NonNull AnimatorUnit> action
)

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

Returns
@NonNull Animator.AnimatorListener

the Animator.AnimatorListener added to the Animator

See also
end

doOnPause

public static final @NonNull Animator.AnimatorPauseListener doOnPause(
    @NonNull Animator receiver,
    @NonNull Function1<@NonNull AnimatorUnit> action
)

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

See also
pause

doOnRepeat

public static final @NonNull Animator.AnimatorListener doOnRepeat(
    @NonNull Animator receiver,
    @NonNull Function1<@NonNull AnimatorUnit> action
)

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

Returns
@NonNull Animator.AnimatorListener

the Animator.AnimatorListener added to the Animator

doOnResume

public static final @NonNull Animator.AnimatorPauseListener doOnResume(
    @NonNull Animator receiver,
    @NonNull Function1<@NonNull AnimatorUnit> action
)

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

See also
resume

doOnStart

public static final @NonNull Animator.AnimatorListener doOnStart(
    @NonNull Animator receiver,
    @NonNull Function1<@NonNull AnimatorUnit> action
)

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

Returns
@NonNull Animator.AnimatorListener

the Animator.AnimatorListener added to the Animator

See also
start