Package icyllis.modernui.animation

# Interface AnimatorListener

public interface AnimatorListener

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `default void`
  `onAnimationCancel(Animator animation)`
  Notifies the cancellation of the animation.
  `default void`
  `onAnimationEnd(Animator animation)`
  Notifies the end of the animation.
  `default void`
  `onAnimationEnd(Animator animation, boolean isReverse)`
  Notifies the end of the animation.
  `default void`
  `onAnimationPause(Animator animation)`
  Notifies that the animation was paused.
  `default void`
  `onAnimationRepeat(Animator animation)`
  Notifies the repetition of the animation.
  `default void`
  `onAnimationResume(Animator animation)`
  Notifies that the animation was resumed, after being previously paused.
  `default void`
  `onAnimationStart(Animator animation)`
  Notifies the start of the animation.
  `default void`
  `onAnimationStart(Animator animation, boolean isReverse)`
  Notifies the start of the animation as well as the animation's overall play direction.

- ## Method Details

  - ### onAnimationStart

    default void onAnimationStart(@NonNull Animator animation, boolean isReverse)

    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` - The started animation.
      `isReverse` - Whether the animation is playing in reverse.

  - ### onAnimationEnd

    default void onAnimationEnd(@NonNull Animator animation, boolean isReverse)

    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` - The animation which reached its end.
      `isReverse` - Whether the animation is playing in reverse.

  - ### onAnimationStart

    default void onAnimationStart(@NonNull Animator animation)

    Notifies the start of the animation.

    Parameters:
      `animation` - The started animation.

  - ### onAnimationEnd

    default void onAnimationEnd(@NonNull Animator animation)

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

    Parameters:
      `animation` - The animation which reached its end.

  - ### onAnimationCancel

    default void onAnimationCancel(@NonNull Animator animation)

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

    Parameters:
      `animation` - The animation which was canceled.

  - ### onAnimationRepeat

    default void onAnimationRepeat(@NonNull Animator animation)

    Notifies the repetition of the animation.

    Parameters:
      `animation` - The animation which was repeated.

  - ### onAnimationPause

    default void onAnimationPause(@NonNull Animator animation)

    Notifies that the animation was paused.

    Parameters:
      `animation` - The animation being paused.
    See Also:
      - `Animator.pause()`

  - ### onAnimationResume

    default void onAnimationResume(@NonNull Animator animation)

    Notifies that the animation was resumed, after being previously paused.

    Parameters:
      `animation` - The animation being resumed.
    See Also:
      - `Animator.resume()`