# 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)

*** ** * ** ***

<br />

```
class SeekableAnimatedVectorDrawable : Drawable, Animatable
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.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/kotlin/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable) |

*** ** * ** ***

This class animates properties of a `https://developer.android.com/reference/kotlin/androidx/vectordrawable/graphics/drawable/VectorDrawableCompat` with animations defined using `https://developer.android.com/reference/kotlin/androidx/core/animation/ObjectAnimator` or `https://developer.android.com/reference/kotlin/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/kotlin/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 |
|---|
| `abstract class https://developer.android.com/reference/kotlin/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable.AnimationCallback` Abstract class for animation callback. |

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

| ### Protected functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#onBoundsChange(android.graphics.Rect)(bounds: https://developer.android.com/reference/android/graphics/Rect.html)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#onLevelChange(int)(level: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#onStateChange(int[])(state: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>)` |

### Inherited functions

From [android.graphics.drawable.Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable.html) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#clearColorFilter()()` `https://developer.android.com/reference/android/graphics/Rect.html!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#copyBounds()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#copyBounds(android.graphics.Rect)(bounds: https://developer.android.com/reference/android/graphics/Rect.html!)` `java-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)(pathName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `java-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)(

res: https://developer.android.com/reference/android/content/res/Resources.html!,

value: https://developer.android.com/reference/android/util/TypedValue.html!,

is: https://developer.android.com/reference/java/io/InputStream.html!,

srcName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!

)` `java-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)(is: https://developer.android.com/reference/java/io/InputStream.html!, srcName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `java-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)(r: https://developer.android.com/reference/android/content/res/Resources.html!, parser: https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html!)` `java-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)(

r: https://developer.android.com/reference/android/content/res/Resources.html!,

parser: https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html!,

attrs: https://developer.android.com/reference/android/util/AttributeSet.html!

)` `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()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getHotspotBounds(android.graphics.Rect)(outRect: https://developer.android.com/reference/android/graphics/Rect.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getLayoutDirection()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getLevel()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getMinimumHeight()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `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()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getOutline(android.graphics.Outline)(outline: https://developer.android.com/reference/android/graphics/Outline.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getPadding(android.graphics.Rect)(padding: https://developer.android.com/reference/android/graphics/Rect.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>!` `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()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#hasFocusStateSpecified()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#invalidateSelf()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#isFilterBitmap()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#isProjected()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#isVisible()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#jumpToCurrentState()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#onLayoutDirectionChanged(int)(layoutDirection: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#resolveOpacity(int, int)(op1: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, op2: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#scheduleSelf(java.lang.Runnable, long)(what: https://developer.android.com/reference/java/lang/Runnable.html!, when: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setBounds(android.graphics.Rect)(bounds: https://developer.android.com/reference/android/graphics/Rect.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setCallback(android.graphics.drawable.Drawable.Callback)(cb: https://developer.android.com/reference/android/graphics/drawable/Drawable.Callback.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setChangingConfigurations(int)(configs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setDither(boolean)(dither: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setFilterBitmap(boolean)(filter: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setHotspot(float, float)(x: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, y: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setHotspotBounds(int, int, int, int)(left: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, top: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, right: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, bottom: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setLayoutDirection(int)(layoutDirection: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setLevel(int)(level: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setState(int[])(stateSet: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setTintBlendMode(android.graphics.BlendMode)(blendMode: https://developer.android.com/reference/android/graphics/BlendMode.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#unscheduleSelf(java.lang.Runnable)(what: https://developer.android.com/reference/java/lang/Runnable.html!)`

## Public functions

### applyTheme

```
fun applyTheme(t: Resources.Theme): Unit
```

### canApplyTheme

```
fun canApplyTheme(): Boolean
```

### clearAnimationCallbacks

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

```
fun clearAnimationCallbacks(): Unit
```

Removes all existing animation callbacks.

### create

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

```
java-static fun create(context: Context, resId: @DrawableRes Int): SeekableAnimatedVectorDrawable?
```

Create a SeekableAnimatedVectorDrawable object.

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html` | the context for creating the animators. |
| `resId: @https://developer.android.com/reference/kotlin/androidx/annotation/DrawableRes https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the resource ID for SeekableAnimatedVectorDrawable object. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/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)

```
java-static fun createFromXmlInner(
    r: Resources,
    parser: XmlPullParser,
    attrs: AttributeSet,
    theme: Resources.Theme?
): SeekableAnimatedVectorDrawable
```

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)

```
fun draw(canvas: Canvas): Unit
```

### getAlpha

```
fun getAlpha(): @IntRange(from = 0, to = 255) Int
```

### getChangingConfigurations

```
fun getChangingConfigurations(): Int
```

### getColorFilter

```
fun getColorFilter(): ColorFilter?
```

### getConstantState

```
fun getConstantState(): Drawable.ConstantState?
```

### getCurrentPlayTime

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

```
fun getCurrentPlayTime(): @IntRange(from = 0) Long
```

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/kotlin/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/kotlin/androidx/annotation/IntRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | the current position in time of the animation in milliseconds |

### getIntrinsicHeight

```
fun getIntrinsicHeight(): Int
```

### getIntrinsicWidth

```
fun getIntrinsicWidth(): Int
```

### 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)

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

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

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The opacity class of the Drawable. |

### getTotalDuration

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

```
fun getTotalDuration(): Long
```

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

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

### inflate

```
fun inflate(res: Resources, parser: XmlPullParser, attrs: AttributeSet): Unit
```

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

### inflate

```
fun inflate(
    res: Resources,
    parser: XmlPullParser,
    attrs: AttributeSet,
    theme: Resources.Theme?
): Unit
```

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

### isAutoMirrored

```
fun isAutoMirrored(): Boolean
```

### isPaused

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

```
fun isPaused(): Boolean
```

Returns whether the animation is currently in a paused state.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if the animation is paused. |

### isRunning

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

```
fun isRunning(): Boolean
```

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

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if the animation is running. |

### isStateful

```
fun isStateful(): Boolean
```

### mutate

```
fun mutate(): Drawable
```

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)

```
fun pause(): Unit
```

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/kotlin/androidx/vectordrawable/graphics/drawable/SeekableAnimatedVectorDrawable#resume()`.

### registerAnimationCallback

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

```
fun registerAnimationCallback(
    callback: SeekableAnimatedVectorDrawable.AnimationCallback
): Unit
```

Adds a callback to listen to the animation events.

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

### resume

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

```
fun resume(): Unit
```

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/kotlin/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)

```
fun setAlpha(alpha: @IntRange(from = 0, to = 255) Int): Unit
```

### setAutoMirrored

```
fun setAutoMirrored(mirrored: Boolean): Unit
```

### setColorFilter

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

```
fun setColorFilter(colorFilter: ColorFilter?): Unit
```

### setCurrentPlayTime

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

```
fun setCurrentPlayTime(playTime: @IntRange(from = 0) Long): Unit
```

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 |
|---|---|
| `playTime: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | 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

```
fun setTint(tint: @ColorInt Int): Unit
```

### setTintList

```
fun setTintList(tint: ColorStateList?): Unit
```

### setTintMode

```
fun setTintMode(tintMode: PorterDuff.Mode?): Unit
```

### setVisible

```
fun setVisible(visible: Boolean, restart: Boolean): Boolean
```

### start

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

```
fun start(): Unit
```

### stop

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

```
fun stop(): Unit
```

### unregisterAnimationCallback

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

```
fun unregisterAnimationCallback(
    callback: SeekableAnimatedVectorDrawable.AnimationCallback
): Boolean
```

Removes the specified animation callback.

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

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `false` if callback didn't exist in the call back list, or `true` if callback has been removed successfully. |

## Protected functions

### onBoundsChange

```
protected fun onBoundsChange(bounds: Rect): Unit
```

### onLevelChange

```
protected fun onLevelChange(level: Int): Boolean
```

### onStateChange

```
protected fun onStateChange(state: IntArray<Int>): Boolean
```