# SeekableAnimatedVectorDrawable

Artifact: [androidx.vectordrawable:vectordrawable-seekable](https://developer.android.com/jetpack/androidx/releases/vectordrawable) [View Source](https://cs.android.com/search?q=file:androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable.java+class:androidx.vectordrawable.graphics.drawable.SeekableAnimatedVectorDrawable) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/vectordrawable#1.0.0)

*** ** * ** ***


```
public class SeekableAnimatedVectorDrawable extends Drawable implements Animatable
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [android.graphics.drawable.Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable.html) ||
|   | ↳ | [androidx.vectordrawable.graphics.drawable.SeekableAnimatedVectorDrawable](https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable) |

*** ** * ** ***

This class animates properties of a `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/VectorDrawableCompat` with animations defined using `https://developer.android.com/reference/androidx/core/animation/ObjectAnimator` or `https://developer.android.com/reference/androidx/core/animation/AnimatorSet`.

SeekableAnimatedVectorDrawable is defined in the same XML format as `https://developer.android.com/reference/android/graphics/drawable/AnimatedVectorDrawable.html`.

Here are all the animatable attributes in `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/VectorDrawableCompat`:

| Element Name | Animatable attribute name |
|---|---|
|   | alpha |
|   | rotation |
| pivotX |
| pivotY |
| scaleX |
| scaleY |
| translateX |
| translateY |
|   | fillColor |
| pathData |
| strokeColor |
| strokeWidth |
| strokeAlpha |
| fillAlpha |
| trimPathStart |
| trimPathEnd |
| trimPathOffset |

You can always create a SeekableAnimatedVectorDrawable object and use it as a Drawable by the Java API. In order to refer to SeekableAnimatedVectorDrawable inside an XML file, you can use app:srcCompat attribute in AppCompat library's ImageButton or ImageView.

SeekableAnimatedVectorDrawable supports the following features too:

- Path Morphing (PathType evaluator). This is used for morphing one path into another.
- Path Interpolation. This is used to defined a flexible interpolator (represented as a path) instead of the system defined ones like LinearInterpolator.
- Animating 2 values in one ObjectAnimator according to one path's X value and Y value. One usage is moving one object in both X and Y dimensions along an path.

Unlike `AnimatedVectorDrawableCompat`, this class does not delegate to the platform `https://developer.android.com/reference/android/graphics/drawable/AnimatedVectorDrawable.html` on any API levels.

## Summary

| ### Nested types |
|---|
| `public abstract class https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable.AnimationCallback` Abstract class for animation callback. |

| ### Public methods |
|---|---|
| `void` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#applyTheme(android.content.res.Resources.Theme)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/res/Resources.Theme.html t)` |
| `boolean` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#canApplyTheme()()` |
| `void` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#clearAnimationCallbacks()()` Removes all existing animation callbacks. |
| `static @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#create(android.content.Context,int)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context, @https://developer.android.com/reference/androidx/annotation/DrawableRes int resId)` Create a SeekableAnimatedVectorDrawable object. |
| `static @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#createFromXmlInner(android.content.res.Resources,org.xmlpull.v1.XmlPullParser,android.util.AttributeSet,android.content.res.Resources.Theme)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/res/Resources.html r, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html parser, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/util/AttributeSet.html attrs, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/content/res/Resources.Theme.html theme )` Create a SeekableAnimatedVectorDrawable from inside an XML document using an optional `https://developer.android.com/reference/android/content/res/Resources.Theme.html`. |
| `void` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#draw(android.graphics.Canvas)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Canvas.html canvas)` |
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0, to = 255) int` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#getAlpha()()` |
| `int` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#getChangingConfigurations()()` |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/graphics/ColorFilter.html` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#getColorFilter()()` |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/graphics/drawable/Drawable.ConstantState.html` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#getConstantState()()` |
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) long` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#getCurrentPlayTime()()` Returns the milliseconds elapsed since the start of the animation. |
| `int` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#getIntrinsicHeight()()` |
| `int` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#getIntrinsicWidth()()` |
| `int` | `[getOpacity](https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#getOpacity())()` **This method is deprecated.** This method is no longer used in graphics optimizations <br /> |
| `long` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#getTotalDuration()()` Gets the total duration of the animation, accounting for animation sequences, start delay, and repeating. |
| `void` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#inflate(android.content.res.Resources,org.xmlpull.v1.XmlPullParser,android.util.AttributeSet)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/res/Resources.html res, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html parser, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/util/AttributeSet.html attrs )` |
| `void` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#inflate(android.content.res.Resources,org.xmlpull.v1.XmlPullParser,android.util.AttributeSet,android.content.res.Resources.Theme)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/res/Resources.html res, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html parser, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/util/AttributeSet.html attrs, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/content/res/Resources.Theme.html theme )` |
| `boolean` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#isAutoMirrored()()` |
| `boolean` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#isPaused()()` Returns whether the animation is currently in a paused state. |
| `boolean` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#isRunning()()` Returns whether the animation is running (has started and not yet ended). |
| `boolean` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#isStateful()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/drawable/Drawable.html` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#mutate()()` mutate() is not supported. |
| `void` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#pause()()` Pauses a running animation. |
| `void` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#registerAnimationCallback(androidx.vectordrawable.graphics.drawable.SeekableAnimatedVectorDrawable.AnimationCallback)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable.AnimationCallback callback )` Adds a callback to listen to the animation events. |
| `void` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#resume()()` Resumes a paused animation. |
| `void` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#setAlpha(int)(@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0, to = 255) int alpha)` |
| `void` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#setAutoMirrored(boolean)(boolean mirrored)` |
| `void` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#setColorFilter(android.graphics.ColorFilter)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/graphics/ColorFilter.html colorFilter)` |
| `void` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#setCurrentPlayTime(long)(@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) long playTime)` Sets the position of the animation to the specified point in time. |
| `void` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#setTint(int)(@https://developer.android.com/reference/androidx/annotation/ColorInt int tint)` |
| `void` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#setTintList(android.content.res.ColorStateList)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/content/res/ColorStateList.html tint)` |
| `void` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#setTintMode(android.graphics.PorterDuff.Mode)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/graphics/PorterDuff.Mode.html tintMode)` |
| `boolean` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#setVisible(boolean,boolean)(boolean visible, boolean restart)` |
| `void` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#start()()` |
| `void` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#stop()()` |
| `boolean` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#unregisterAnimationCallback(androidx.vectordrawable.graphics.drawable.SeekableAnimatedVectorDrawable.AnimationCallback)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable.AnimationCallback callback )` Removes the specified animation callback. |

| ### Protected methods |
|---|---|
| `void` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#onBoundsChange(android.graphics.Rect)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html bounds)` |
| `boolean` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#onLevelChange(int)(int level)` |
| `boolean` | `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#onStateChange(int[])(@https://developer.android.com/reference/androidx/annotation/NonNull int[] state)` |

| ### Inherited methods |
|---|
| From [android.graphics.drawable.Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable.html) |---|---| | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#clearColorFilter()()` | | `final https://developer.android.com/reference/android/graphics/Rect.html` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#copyBounds()()` | | `final void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#copyBounds(android.graphics.Rect)(https://developer.android.com/reference/android/graphics/Rect.html bounds)` | | `static https://developer.android.com/reference/android/graphics/drawable/Drawable.html` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#createFromPath(java.lang.String)(https://developer.android.com/reference/java/lang/String.html pathName)` | | `static https://developer.android.com/reference/android/graphics/drawable/Drawable.html` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#createFromResourceStream(android.content.res.Resources, android.util.TypedValue, java.io.InputStream, java.lang.String)( https://developer.android.com/reference/android/content/res/Resources.html res, https://developer.android.com/reference/android/util/TypedValue.html value, https://developer.android.com/reference/java/io/InputStream.html is, https://developer.android.com/reference/java/lang/String.html srcName )` | | `static https://developer.android.com/reference/android/graphics/drawable/Drawable.html` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#createFromStream(java.io.InputStream, java.lang.String)(https://developer.android.com/reference/java/io/InputStream.html is, https://developer.android.com/reference/java/lang/String.html srcName)` | | `static https://developer.android.com/reference/android/graphics/drawable/Drawable.html` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#createFromXml(android.content.res.Resources, org.xmlpull.v1.XmlPullParser)(https://developer.android.com/reference/android/content/res/Resources.html r, https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html parser)` | | `static https://developer.android.com/reference/android/graphics/drawable/Drawable.html` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#createFromXmlInner(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet)( https://developer.android.com/reference/android/content/res/Resources.html r, https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html parser, https://developer.android.com/reference/android/util/AttributeSet.html attrs )` | | `final https://developer.android.com/reference/android/graphics/Rect.html` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getBounds()()` | | `https://developer.android.com/reference/android/graphics/drawable/Drawable.Callback.html` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getCallback()()` | | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getCurrent()()` | | `https://developer.android.com/reference/android/graphics/Rect.html` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getDirtyBounds()()` | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getHotspotBounds(android.graphics.Rect)(https://developer.android.com/reference/android/graphics/Rect.html outRect)` | | `int` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getLayoutDirection()()` | | `final int` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getLevel()()` | | `int` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getMinimumHeight()()` | | `int` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getMinimumWidth()()` | | `https://developer.android.com/reference/android/graphics/Insets.html` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getOpticalInsets()()` | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getOutline(android.graphics.Outline)(https://developer.android.com/reference/android/graphics/Outline.html outline)` | | `boolean` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getPadding(android.graphics.Rect)(https://developer.android.com/reference/android/graphics/Rect.html padding)` | | `int[]` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getState()()` | | `https://developer.android.com/reference/android/graphics/Region.html` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getTransparentRegion()()` | | `boolean` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#hasFocusStateSpecified()()` | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#invalidateSelf()()` | | `boolean` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#isFilterBitmap()()` | | `boolean` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#isProjected()()` | | `final boolean` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#isVisible()()` | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#jumpToCurrentState()()` | | `boolean` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#onLayoutDirectionChanged(int)(int layoutDirection)` | | `static int` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#resolveOpacity(int, int)(int op1, int op2)` | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#scheduleSelf(java.lang.Runnable, long)(https://developer.android.com/reference/java/lang/Runnable.html what, long when)` | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setBounds(android.graphics.Rect)(https://developer.android.com/reference/android/graphics/Rect.html bounds)` | | `final void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setCallback(android.graphics.drawable.Drawable.Callback)(https://developer.android.com/reference/android/graphics/drawable/Drawable.Callback.html cb)` | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setChangingConfigurations(int)(int configs)` | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setDither(boolean)(boolean dither)` **This method is deprecated.** | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setFilterBitmap(boolean)(boolean filter)` | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setHotspot(float, float)(float x, float y)` | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setHotspotBounds(int, int, int, int)(int left, int top, int right, int bottom)` | | `final boolean` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setLayoutDirection(int)(int layoutDirection)` | | `final boolean` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setLevel(int)(int level)` | | `boolean` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setState(int[])(int[] stateSet)` | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setTintBlendMode(android.graphics.BlendMode)(https://developer.android.com/reference/android/graphics/BlendMode.html blendMode)` | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#unscheduleSelf(java.lang.Runnable)(https://developer.android.com/reference/java/lang/Runnable.html what)` | |

## Public methods

### applyTheme

```
public void applyTheme(@NonNull Resources.Theme t)
```

### canApplyTheme

```
public boolean canApplyTheme()
```

### clearAnimationCallbacks

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/vectordrawable#1.0.0)

```
public void clearAnimationCallbacks()
```

Removes all existing animation callbacks.

### create

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/vectordrawable#1.0.0)

```
public static @Nullable SeekableAnimatedVectorDrawable create(@NonNull Context context, @DrawableRes int resId)
```

Create a SeekableAnimatedVectorDrawable object.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context` | the context for creating the animators. |
| `@https://developer.android.com/reference/androidx/annotation/DrawableRes int resId` | the resource ID for SeekableAnimatedVectorDrawable object. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable` | a new SeekableAnimatedVectorDrawable or null if parsing error is found. |

### createFromXmlInner

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/vectordrawable#1.0.0)

```
public static @NonNull SeekableAnimatedVectorDrawable createFromXmlInner(
    @NonNull Resources r,
    @NonNull XmlPullParser parser,
    @NonNull AttributeSet attrs,
    @Nullable Resources.Theme theme
)
```

Create a SeekableAnimatedVectorDrawable from inside an XML document using an optional `https://developer.android.com/reference/android/content/res/Resources.Theme.html`. Called on a parser positioned at a tag in an XML document, tries to create a Drawable from that tag. Returns `null` if the tag is not a valid drawable.

| Throws |
|---|---|
| `https://developer.android.com/reference/org/xmlpull/v1/XmlPullParserException.html` |   |
| `https://developer.android.com/reference/java/io/IOException.html` |   |

### draw

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/vectordrawable#1.0.0)

```
public void draw(@NonNull Canvas canvas)
```

### getAlpha

```
public @IntRange(from = 0, to = 255) int getAlpha()
```

### getChangingConfigurations

```
public int getChangingConfigurations()
```

### getColorFilter

```
public @Nullable ColorFilter getColorFilter()
```

### getConstantState

```
public @Nullable Drawable.ConstantState getConstantState()
```

### getCurrentPlayTime

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/vectordrawable#1.0.0)

```
public @IntRange(from = 0) long getCurrentPlayTime()
```

Returns the milliseconds elapsed since the start of the animation.

For ongoing animations, this method returns the current progress of the animation in terms of play time. For an animation that has not yet been started: if the animation has been seeked to a certain time via `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#setCurrentPlayTime(long)`, the seeked play time will be returned; otherwise, this method will return 0.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) long` | the current position in time of the animation in milliseconds |

### getIntrinsicHeight

```
public int getIntrinsicHeight()
```

### getIntrinsicWidth

```
public int getIntrinsicWidth()
```

### getOpacity

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/vectordrawable#1.0.0) Deprecated in [1.0.0](https://developer.android.com/jetpack/androidx/releases/vectordrawable#1.0.0)

```
public int [getOpacity](https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#getOpacity())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> This method is no longer used in graphics optimizations

| Returns |
|---|---|
| `int` | The opacity class of the Drawable. |

### getTotalDuration

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/vectordrawable#1.0.0)

```
public long getTotalDuration()
```

Gets the total duration of the animation, accounting for animation sequences, start delay, and repeating. Return `https://developer.android.com/reference/androidx/core/animation/Animator#DURATION_INFINITE()` if the duration is infinite.

| Returns |
|---|---|
| `long` | Total time the animation takes to finish, starting from the time `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#start()` is called. `https://developer.android.com/reference/androidx/core/animation/Animator#DURATION_INFINITE()` if the animation or any of the child animations repeats infinite times. |

### inflate

```
public void inflate(
    @NonNull Resources res,
    @NonNull XmlPullParser parser,
    @NonNull AttributeSet attrs
)
```

| Throws |
|---|---|
| `https://developer.android.com/reference/org/xmlpull/v1/XmlPullParserException.html` |   |
| `https://developer.android.com/reference/java/io/IOException.html` |   |

### inflate

```
public void inflate(
    @NonNull Resources res,
    @NonNull XmlPullParser parser,
    @NonNull AttributeSet attrs,
    @Nullable Resources.Theme theme
)
```

| Throws |
|---|---|
| `https://developer.android.com/reference/org/xmlpull/v1/XmlPullParserException.html` |   |
| `https://developer.android.com/reference/java/io/IOException.html` |   |

### isAutoMirrored

```
public boolean isAutoMirrored()
```

### isPaused

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/vectordrawable#1.0.0)

```
public boolean isPaused()
```

Returns whether the animation is currently in a paused state.

| Returns |
|---|---|
| `boolean` | `true` if the animation is paused. |

### isRunning

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/vectordrawable#1.0.0)

```
public boolean isRunning()
```

Returns whether the animation is running (has started and not yet ended).

| Returns |
|---|---|
| `boolean` | `true` if the animation is running. |

### isStateful

```
public boolean isStateful()
```

### mutate

```
public @NonNull Drawable mutate()
```

mutate() is not supported. This method simply returns `this`.

### pause

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/vectordrawable#1.0.0)

```
public void pause()
```

Pauses a running animation. This method should only be called on the same thread on which the animation was started. If the animation has not yet been started or has since ended, then the call is ignored. Paused animations can be resumed by calling `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#resume()`.

### registerAnimationCallback

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/vectordrawable#1.0.0)

```
public void registerAnimationCallback(
    @NonNull SeekableAnimatedVectorDrawable.AnimationCallback callback
)
```

Adds a callback to listen to the animation events.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable.AnimationCallback callback` | Callback to add. |

### resume

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/vectordrawable#1.0.0)

```
public void resume()
```

Resumes a paused animation. The animation resumes from where it left off when it was paused. This method should only be called on the same thread on which the animation was started. Calls will be ignored if this `https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable` is not currently paused.

### setAlpha

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/vectordrawable#1.0.0)

```
public void setAlpha(@IntRange(from = 0, to = 255) int alpha)
```

### setAutoMirrored

```
public void setAutoMirrored(boolean mirrored)
```

### setColorFilter

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/vectordrawable#1.0.0)

```
public void setColorFilter(@Nullable ColorFilter colorFilter)
```

### setCurrentPlayTime

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/vectordrawable#1.0.0)

```
public void setCurrentPlayTime(@IntRange(from = 0) long playTime)
```

Sets the position of the animation to the specified point in time. This time should be between 0 and the total duration of the animation, including any repetition. If the animation has not yet been started, then it will not advance forward after it is set to this time; it will simply set the time to this value and perform any appropriate actions based on that time. If the animation is already running, then setCurrentPlayTime() will set the current playing time to this value and continue playing from that point.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) long playTime` | The time, in milliseconds, to which the animation is advanced or rewound. Unless the animation is reversing, the playtime is considered the time since the end of the start delay of the AnimatorSet in a forward playing direction. |

### setTint

```
public void setTint(@ColorInt int tint)
```

### setTintList

```
public void setTintList(@Nullable ColorStateList tint)
```

### setTintMode

```
public void setTintMode(@Nullable PorterDuff.Mode tintMode)
```

### setVisible

```
public boolean setVisible(boolean visible, boolean restart)
```

### start

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/vectordrawable#1.0.0)

```
public void start()
```

### stop

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/vectordrawable#1.0.0)

```
public void stop()
```

### unregisterAnimationCallback

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/vectordrawable#1.0.0)

```
public boolean unregisterAnimationCallback(
    @NonNull SeekableAnimatedVectorDrawable.AnimationCallback callback
)
```

Removes the specified animation callback.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable.AnimationCallback callback` | Callback to remove. |

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

## Protected methods

### onBoundsChange

```
protected void onBoundsChange(@NonNull Rect bounds)
```

### onLevelChange

```
protected boolean onLevelChange(int level)
```

### onStateChange

```
protected boolean onStateChange(@NonNull int[] state)
```