Stay organized with collections
Save and categorize content based on your preferences.
Animator.AnimatorListener
public
static
interface
Animator.AnimatorListener
android.animation.Animator.AnimatorListener
|
Known indirect subclasses
|
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
onAnimationCancel
public abstract void onAnimationCancel (Animator animation)
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
public abstract void onAnimationEnd (Animator animation)
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 . |
onAnimationEnd
public void onAnimationEnd (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(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. |
onAnimationRepeat
public abstract void onAnimationRepeat (Animator animation)
Notifies the repetition of the animation.
Parameters |
animation |
Animator : The animation which was repeated.
This value cannot be null . |
onAnimationStart
public abstract void onAnimationStart (Animator animation)
Notifies the start of the animation.
Parameters |
animation |
Animator : The started animation.
This value cannot be null . |
onAnimationStart
public void onAnimationStart (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(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. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# Animator.AnimatorListener\n\nAdded in [API level 11](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Methods](#pubmethods) \n\nAnimator.AnimatorListener\n=========================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/animation/Animator.AnimatorListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nAnimator.AnimatorListener\n`\n\n\n`\n\n\n`\n\n|---------------------------------------------|\n| android.animation.Animator.AnimatorListener |\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known indirect subclasses [AnimatorListenerAdapter](/reference/android/animation/AnimatorListenerAdapter) |---------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------| | [AnimatorListenerAdapter](/reference/android/animation/AnimatorListenerAdapter) | This adapter class provides empty implementations of the methods from [Animator.AnimatorListener](/reference/android/animation/Animator.AnimatorListener). | |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n\u003cbr /\u003e\n\nAn animation listener receives notifications from an animation.\nNotifications indicate animation related events, such as the end or the\nrepetition of the animation.\n\n\u003cbr /\u003e\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onAnimationCancel](/reference/android/animation/Animator.AnimatorListener#onAnimationCancel(android.animation.Animator))`(`[Animator](/reference/android/animation/Animator)` animation) ` \u003cbr /\u003e Notifies the cancellation of the animation. |\n| ` abstract void` | ` `[onAnimationEnd](/reference/android/animation/Animator.AnimatorListener#onAnimationEnd(android.animation.Animator))`(`[Animator](/reference/android/animation/Animator)` animation) ` \u003cbr /\u003e Notifies the end of the animation. |\n| ` default void` | ` `[onAnimationEnd](/reference/android/animation/Animator.AnimatorListener#onAnimationEnd(android.animation.Animator,%20boolean))`(`[Animator](/reference/android/animation/Animator)` animation, boolean isReverse) ` \u003cbr /\u003e Notifies the end of the animation. |\n| ` abstract void` | ` `[onAnimationRepeat](/reference/android/animation/Animator.AnimatorListener#onAnimationRepeat(android.animation.Animator))`(`[Animator](/reference/android/animation/Animator)` animation) ` \u003cbr /\u003e Notifies the repetition of the animation. |\n| ` abstract void` | ` `[onAnimationStart](/reference/android/animation/Animator.AnimatorListener#onAnimationStart(android.animation.Animator))`(`[Animator](/reference/android/animation/Animator)` animation) ` \u003cbr /\u003e Notifies the start of the animation. |\n| ` default void` | ` `[onAnimationStart](/reference/android/animation/Animator.AnimatorListener#onAnimationStart(android.animation.Animator,%20boolean))`(`[Animator](/reference/android/animation/Animator)` animation, boolean isReverse) ` \u003cbr /\u003e Notifies the start of the animation as well as the animation's overall play direction. |\n\nPublic methods\n--------------\n\n### onAnimationCancel\n\nAdded in [API level 11](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onAnimationCancel (Animator animation)\n```\n\n\u003cbr /\u003e\n\nNotifies the cancellation of the animation. This callback is not invoked\nfor animations with repeat count set to INFINITE.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------|-----------------------------------------------------------------------------------|\n| `animation` | `Animator`: The animation which was canceled. This value cannot be `null`. \u003cbr /\u003e |\n\n### onAnimationEnd\n\nAdded in [API level 11](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onAnimationEnd (Animator animation)\n```\n\n\u003cbr /\u003e\n\nNotifies the end of the animation. This callback is not invoked\nfor animations with repeat count set to INFINITE.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------|--------------------------------------------------------------------------------------|\n| `animation` | `Animator`: The animation which reached its end. This value cannot be `null`. \u003cbr /\u003e |\n\n### onAnimationEnd\n\nAdded in [API level 26](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic void onAnimationEnd (Animator animation, \n boolean isReverse)\n```\n\n\u003cbr /\u003e\n\nNotifies the end of the animation. This callback is not invoked\nfor animations with repeat count set to INFINITE.\n\nThis method's default behavior is to call [onAnimationEnd(android.animation.Animator)](/reference/android/animation/Animator.AnimatorListener#onAnimationEnd(android.animation.Animator)). This\nmethod can be overridden, though not required, to get the additional play direction info\nwhen an animation ends. Skipping calling super when overriding this method results in\n[onAnimationEnd(android.animation.Animator)](/reference/android/animation/Animator.AnimatorListener#onAnimationEnd(android.animation.Animator)) not getting called.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------|--------------------------------------------------------------------------------------|\n| `animation` | `Animator`: The animation which reached its end. This value cannot be `null`. \u003cbr /\u003e |\n| `isReverse` | `boolean`: Whether the animation is playing in reverse. \u003cbr /\u003e |\n\n### onAnimationRepeat\n\nAdded in [API level 11](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onAnimationRepeat (Animator animation)\n```\n\n\u003cbr /\u003e\n\nNotifies the repetition of the animation.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------|-----------------------------------------------------------------------------------|\n| `animation` | `Animator`: The animation which was repeated. This value cannot be `null`. \u003cbr /\u003e |\n\n### onAnimationStart\n\nAdded in [API level 11](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onAnimationStart (Animator animation)\n```\n\n\u003cbr /\u003e\n\nNotifies the start of the animation.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------|------------------------------------------------------------------------|\n| `animation` | `Animator`: The started animation. This value cannot be `null`. \u003cbr /\u003e |\n\n### onAnimationStart\n\nAdded in [API level 26](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic void onAnimationStart (Animator animation, \n boolean isReverse)\n```\n\n\u003cbr /\u003e\n\nNotifies the start of the animation as well as the animation's overall play direction.\nThis method's default behavior is to call [onAnimationStart(android.animation.Animator)](/reference/android/animation/Animator.AnimatorListener#onAnimationStart(android.animation.Animator)). This\nmethod can be overridden, though not required, to get the additional play direction info\nwhen an animation starts. Skipping calling super when overriding this method results in\n[onAnimationStart(android.animation.Animator)](/reference/android/animation/Animator.AnimatorListener#onAnimationStart(android.animation.Animator)) not getting called.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------|------------------------------------------------------------------------|\n| `animation` | `Animator`: The started animation. This value cannot be `null`. \u003cbr /\u003e |\n| `isReverse` | `boolean`: Whether the animation is playing in reverse. \u003cbr /\u003e |"]]