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.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# Animatable2Compat\n\nadded in [version 25.4.0](/topic/libraries/support-library/revisions) \nbelongs to Maven artifact com.android.support:animated-vector-drawable:28.0.0-alpha1 \nSummary: [Nested Classes](#nestedclasses) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \\| [\\[Expand All\\]](#) \n\nAnimatable2Compat\n=================\n\n| This package is part of the Android [support library](/topic/libraries/support-library) which is no longer maintained. The support library has been superseded by [AndroidX](/jetpack/androidx) which is part of [Jetpack](/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider [migrating](/jetpack/androidx/migrate) existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library [class\n| mappings](/jetpack/androidx/migrate/class-mappings).\n\n\n`\npublic\n\n\ninterface\nAnimatable2Compat\n`\n\n\n`\n\n\nimplements\n\n`[Animatable](https://developer.android.com/reference/android/graphics/drawable/Animatable.html)`\n\n\n`\n\n|-----------------------------------------------------|\n| android.support.graphics.drawable.Animatable2Compat |\n\n|---|---|\n| Known Indirect Subclasses [AnimatedVectorDrawableCompat](/reference/android/support/graphics/drawable/AnimatedVectorDrawableCompat) |-----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [AnimatedVectorDrawableCompat](/reference/android/support/graphics/drawable/AnimatedVectorDrawableCompat) | For API 24 and above, this class is delegating to the framework's [AnimatedVectorDrawable](https://developer.android.com/reference/android/graphics/drawable/AnimatedVectorDrawable.html). | ||\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nInterface that drawables supporting animations and callbacks should extend in support lib.\n\nSummary\n-------\n\n| ### Nested classes ||\n|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` class` | [Animatable2Compat.AnimationCallback](/reference/android/support/graphics/drawable/Animatable2Compat.AnimationCallback) Abstract class for animation callback. |\n\n| ### Public methods ||\n|---------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[clearAnimationCallbacks](/reference/android/support/graphics/drawable/Animatable2Compat#clearAnimationCallbacks())`() ` Removes all existing animation callbacks. |\n| ` abstract void` | ` `[registerAnimationCallback](/reference/android/support/graphics/drawable/Animatable2Compat#registerAnimationCallback(android.support.graphics.drawable.Animatable2Compat.AnimationCallback))`(`[Animatable2Compat.AnimationCallback](/reference/android/support/graphics/drawable/Animatable2Compat.AnimationCallback)` callback) ` Adds a callback to listen to the animation events. |\n| ` abstract boolean` | ` `[unregisterAnimationCallback](/reference/android/support/graphics/drawable/Animatable2Compat#unregisterAnimationCallback(android.support.graphics.drawable.Animatable2Compat.AnimationCallback))`(`[Animatable2Compat.AnimationCallback](/reference/android/support/graphics/drawable/Animatable2Compat.AnimationCallback)` callback) ` Removes the specified animation callback. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From interface ` `[android.graphics.drawable.Animatable](https://developer.android.com/reference/android/graphics/drawable/Animatable.html)` ` |---------------------|-----------------| | ` abstract boolean` | ` isRunning() ` | | ` abstract void` | ` start() ` | | ` abstract void` | ` stop() ` | ||\n\nPublic methods\n--------------\n\n### clearAnimationCallbacks\n\nadded in [version 25.4.0](/topic/libraries/support-library/revisions) \n\n```\nvoid clearAnimationCallbacks ()\n```\n\nRemoves all existing animation callbacks.\n\n\u003cbr /\u003e\n\n### registerAnimationCallback\n\nadded in [version 25.4.0](/topic/libraries/support-library/revisions) \n\n```\nvoid registerAnimationCallback (Animatable2Compat.AnimationCallback callback)\n```\n\nAdds a callback to listen to the animation events.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|----------------------------------------------------------------|\n| `callback` | `Animatable2Compat.AnimationCallback`: Callback to add. \u003cbr /\u003e |\n\n### unregisterAnimationCallback\n\nadded in [version 25.4.0](/topic/libraries/support-library/revisions) \n\n```\nboolean unregisterAnimationCallback (Animatable2Compat.AnimationCallback callback)\n```\n\nRemoves the specified animation callback.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|-------------------------------------------------------------------|\n| `callback` | `Animatable2Compat.AnimationCallback`: Callback to remove. \u003cbr /\u003e |\n\n| Returns ||\n|-----------|---------------------------------------------------------------------------------------------------------------------|\n| `boolean` | `false` if callback didn't exist in the call back list, or `true` if callback has been removed successfully. \u003cbr /\u003e |\n\n-\n\n Interfaces\n ----------\n\n - [Animatable2Compat](/reference/android/support/graphics/drawable/Animatable2Compat)\n-\n\n Classes\n -------\n\n - [Animatable2Compat.AnimationCallback](/reference/android/support/graphics/drawable/Animatable2Compat.AnimationCallback)\n - [AnimatedVectorDrawableCompat](/reference/android/support/graphics/drawable/AnimatedVectorDrawableCompat)\n - [R](/reference/android/support/graphics/drawable/R)\n - [R.attr](/reference/android/support/graphics/drawable/R.attr)\n - [R.bool](/reference/android/support/graphics/drawable/R.bool)\n - [R.color](/reference/android/support/graphics/drawable/R.color)\n - [R.dimen](/reference/android/support/graphics/drawable/R.dimen)\n - [R.drawable](/reference/android/support/graphics/drawable/R.drawable)\n - [R.id](/reference/android/support/graphics/drawable/R.id)\n - [R.integer](/reference/android/support/graphics/drawable/R.integer)\n - [R.layout](/reference/android/support/graphics/drawable/R.layout)\n - [R.string](/reference/android/support/graphics/drawable/R.string)\n - [R.style](/reference/android/support/graphics/drawable/R.style)\n - [R.styleable](/reference/android/support/graphics/drawable/R.styleable)\n - [VectorDrawableCompat](/reference/android/support/graphics/drawable/VectorDrawableCompat)"]]