# Animatable2Compat

added in[version 25.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:animated-vector-drawable:28.0.0-alpha1  
Summary:[Nested Classes](https://developer.android.com/reference/android/support/graphics/drawable/Animatable2Compat#nestedclasses)\|[Methods](https://developer.android.com/reference/android/support/graphics/drawable/Animatable2Compat#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/graphics/drawable/Animatable2Compat#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/graphics/drawable/Animatable2Compat#)  

# Animatable2Compat

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public


interface
Animatable2Compat
`  
`


implements

`[Animatable](https://developer.android.com/reference/android/graphics/drawable/Animatable.html)`


`

|-----------------------------------------------------|
| android.support.graphics.drawable.Animatable2Compat |

|---|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/graphics/drawable/Animatable2Compat#)Known Indirect Subclasses [AnimatedVectorDrawableCompat](https://developer.android.com/reference/android/support/graphics/drawable/AnimatedVectorDrawableCompat) |----------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [AnimatedVectorDrawableCompat](https://developer.android.com/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). | ||

<br />

*** ** * ** ***

Interface that drawables supporting animations and callbacks should extend in support lib.

## Summary

|                                                                                          ### Nested classes                                                                                           ||
|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` class` | [Animatable2Compat.AnimationCallback](https://developer.android.com/reference/android/support/graphics/drawable/Animatable2Compat.AnimationCallback) Abstract class for animation callback. |

|                                                                                                                                                                                                                            ### Public methods                                                                                                                                                                                                                            ||
|---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract void`    | ` `[clearAnimationCallbacks](https://developer.android.com/reference/android/support/graphics/drawable/Animatable2Compat#clearAnimationCallbacks())`() ` Removes all existing animation callbacks.                                                                                                                                                                                                                                                  |
| ` abstract void`    | ` `[registerAnimationCallback](https://developer.android.com/reference/android/support/graphics/drawable/Animatable2Compat#registerAnimationCallback(android.support.graphics.drawable.Animatable2Compat.AnimationCallback))`(`[Animatable2Compat.AnimationCallback](https://developer.android.com/reference/android/support/graphics/drawable/Animatable2Compat.AnimationCallback)` callback) ` Adds a callback to listen to the animation events. |
| ` abstract boolean` | ` `[unregisterAnimationCallback](https://developer.android.com/reference/android/support/graphics/drawable/Animatable2Compat#unregisterAnimationCallback(android.support.graphics.drawable.Animatable2Compat.AnimationCallback))`(`[Animatable2Compat.AnimationCallback](https://developer.android.com/reference/android/support/graphics/drawable/Animatable2Compat.AnimationCallback)` callback) ` Removes the specified animation callback.      |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/graphics/drawable/Animatable2Compat#)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() `      | ||

## Public methods

### clearAnimationCallbacks

added in[version 25.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void clearAnimationCallbacks ()
```

Removes all existing animation callbacks.

<br />

### registerAnimationCallback

added in[version 25.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void registerAnimationCallback (Animatable2Compat.AnimationCallback callback)
```

Adds a callback to listen to the animation events.

<br />

|                                 Parameters                                 ||
|------------|----------------------------------------------------------------|
| `callback` | `Animatable2Compat.AnimationCallback`: Callback to add. <br /> |

### unregisterAnimationCallback

added in[version 25.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean unregisterAnimationCallback (Animatable2Compat.AnimationCallback callback)
```

Removes the specified animation callback.

<br />

|                                  Parameters                                   ||
|------------|-------------------------------------------------------------------|
| `callback` | `Animatable2Compat.AnimationCallback`: Callback to remove. <br /> |

|                                                           Returns                                                           ||
|-----------|------------------------------------------------------------------------------------------------------------------|
| `boolean` | `false`if callback didn't exist in the call back list, or`true`if callback has been removed successfully. <br /> |

-

  ## Interfaces

  - [Animatable2Compat](https://developer.android.com/reference/android/support/graphics/drawable/Animatable2Compat)
-

  ## Classes

  - [Animatable2Compat.AnimationCallback](https://developer.android.com/reference/android/support/graphics/drawable/Animatable2Compat.AnimationCallback)
  - [AnimatedVectorDrawableCompat](https://developer.android.com/reference/android/support/graphics/drawable/AnimatedVectorDrawableCompat)
  - [R](https://developer.android.com/reference/android/support/graphics/drawable/R)
  - [R.attr](https://developer.android.com/reference/android/support/graphics/drawable/R.attr)
  - [R.bool](https://developer.android.com/reference/android/support/graphics/drawable/R.bool)
  - [R.color](https://developer.android.com/reference/android/support/graphics/drawable/R.color)
  - [R.dimen](https://developer.android.com/reference/android/support/graphics/drawable/R.dimen)
  - [R.drawable](https://developer.android.com/reference/android/support/graphics/drawable/R.drawable)
  - [R.id](https://developer.android.com/reference/android/support/graphics/drawable/R.id)
  - [R.integer](https://developer.android.com/reference/android/support/graphics/drawable/R.integer)
  - [R.layout](https://developer.android.com/reference/android/support/graphics/drawable/R.layout)
  - [R.string](https://developer.android.com/reference/android/support/graphics/drawable/R.string)
  - [R.style](https://developer.android.com/reference/android/support/graphics/drawable/R.style)
  - [R.styleable](https://developer.android.com/reference/android/support/graphics/drawable/R.styleable)
  - [VectorDrawableCompat](https://developer.android.com/reference/android/support/graphics/drawable/VectorDrawableCompat)