Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [XML Attrs](https://developer.android.com/reference/android/graphics/drawable/AnimatedStateListDrawable#lattrs) \| [Inherited XML Attrs](https://developer.android.com/reference/android/graphics/drawable/AnimatedStateListDrawable#inhattrs) \| [Ctors](https://developer.android.com/reference/android/graphics/drawable/AnimatedStateListDrawable#pubctors) \| [Methods](https://developer.android.com/reference/android/graphics/drawable/AnimatedStateListDrawable#pubmethods) \| [Protected Methods](https://developer.android.com/reference/android/graphics/drawable/AnimatedStateListDrawable#promethods) \| [Inherited Methods](https://developer.android.com/reference/android/graphics/drawable/AnimatedStateListDrawable#inhmethods)

# AnimatedStateListDrawable

*** ** * ** ***


`
public


class
AnimatedStateListDrawable
`


`


`

`


`

`


`

`

extends https://developer.android.com/reference/android/graphics/drawable/StateListDrawable


`

`


`

|---|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||||
| ↳ | [android.graphics.drawable.Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable) ||||
|   | ↳ | [android.graphics.drawable.DrawableContainer](https://developer.android.com/reference/android/graphics/drawable/DrawableContainer) |||
|   |   | ↳ | [android.graphics.drawable.StateListDrawable](https://developer.android.com/reference/android/graphics/drawable/StateListDrawable) ||
|   |   |   | ↳ | android.graphics.drawable.AnimatedStateListDrawable |

<br />

*** ** * ** ***

Drawable containing a set of Drawable keyframes where the currently displayed
keyframe is chosen based on the current state set. Animations between
keyframes may optionally be defined using transition elements.


This drawable can be defined in an XML file with the `
<animated-selector>` element. Each keyframe Drawable is defined in a
nested `<item>` element. Transitions are defined in a nested
`<transition>` element.

## Summary

| ### XML attributes ||
|---|---|
| [`android:state_activated`](https://developer.android.com/reference/android/graphics/drawable/AnimatedStateListDrawable#attr_android:state_activated) | State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`, set when a view or its parent has been "activated" meaning the user has currently marked it as being of interest. |
| [`android:state_active`](https://developer.android.com/reference/android/graphics/drawable/AnimatedStateListDrawable#attr_android:state_active) | State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`, set when a view or drawable is considered "active" by its host. |
| [`android:state_checkable`](https://developer.android.com/reference/android/graphics/drawable/AnimatedStateListDrawable#attr_android:state_checkable) | State identifier indicating that the object <var translate="no">may</var> display a check mark. |
| [`android:state_checked`](https://developer.android.com/reference/android/graphics/drawable/AnimatedStateListDrawable#attr_android:state_checked) | State identifier indicating that the object is currently checked. |
| [`android:state_enabled`](https://developer.android.com/reference/android/graphics/drawable/AnimatedStateListDrawable#attr_android:state_enabled) | State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`, set when a view is enabled. |
| [`android:state_first`](https://developer.android.com/reference/android/graphics/drawable/AnimatedStateListDrawable#attr_android:state_first) | State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`, set when a view or drawable is in the first position in an ordered set. |
| [`android:state_focused`](https://developer.android.com/reference/android/graphics/drawable/AnimatedStateListDrawable#attr_android:state_focused) | State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`, set when a view has input focus. |
| [`android:state_last`](https://developer.android.com/reference/android/graphics/drawable/AnimatedStateListDrawable#attr_android:state_last) | State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`, set when a view or drawable is in the last position in an ordered set. |
| [`android:state_middle`](https://developer.android.com/reference/android/graphics/drawable/AnimatedStateListDrawable#attr_android:state_middle) | State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`, set when a view or drawable is in the middle position in an ordered set. |
| [`android:state_pressed`](https://developer.android.com/reference/android/graphics/drawable/AnimatedStateListDrawable#attr_android:state_pressed) | State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`, set when the user is pressing down in a view. |
| [`android:state_selected`](https://developer.android.com/reference/android/graphics/drawable/AnimatedStateListDrawable#attr_android:state_selected) | State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`, set when a view (or one of its parents) is currently selected. |
| [`android:state_single`](https://developer.android.com/reference/android/graphics/drawable/AnimatedStateListDrawable#attr_android:state_single) | State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`, set when a view or drawable is considered "single" by its host. |
| [`android:state_window_focused`](https://developer.android.com/reference/android/graphics/drawable/AnimatedStateListDrawable#attr_android:state_window_focused) | State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`, set when a view's window has input focus. |

| ### Inherited XML attributes |
|---|---|
| From class `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable` |---|---| | [`android:constantSize`](https://developer.android.com/reference/android/graphics/drawable/StateListDrawable#attr_android:constantSize) | If true, the drawable's reported internal size will remain constant as the state changes; the size is the maximum of all of the states. | | [`android:state_activated`](https://developer.android.com/reference/android/graphics/drawable/StateListDrawable#attr_android:state_activated) | State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`, set when a view or its parent has been "activated" meaning the user has currently marked it as being of interest. | | [`android:state_active`](https://developer.android.com/reference/android/graphics/drawable/StateListDrawable#attr_android:state_active) | State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`, set when a view or drawable is considered "active" by its host. | | [`android:state_checkable`](https://developer.android.com/reference/android/graphics/drawable/StateListDrawable#attr_android:state_checkable) | State identifier indicating that the object <var translate="no">may</var> display a check mark. | | [`android:state_checked`](https://developer.android.com/reference/android/graphics/drawable/StateListDrawable#attr_android:state_checked) | State identifier indicating that the object is currently checked. | | [`android:state_enabled`](https://developer.android.com/reference/android/graphics/drawable/StateListDrawable#attr_android:state_enabled) | State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`, set when a view is enabled. | | [`android:state_first`](https://developer.android.com/reference/android/graphics/drawable/StateListDrawable#attr_android:state_first) | State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`, set when a view or drawable is in the first position in an ordered set. | | [`android:state_focused`](https://developer.android.com/reference/android/graphics/drawable/StateListDrawable#attr_android:state_focused) | State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`, set when a view has input focus. | | [`android:state_last`](https://developer.android.com/reference/android/graphics/drawable/StateListDrawable#attr_android:state_last) | State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`, set when a view or drawable is in the last position in an ordered set. | | [`android:state_middle`](https://developer.android.com/reference/android/graphics/drawable/StateListDrawable#attr_android:state_middle) | State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`, set when a view or drawable is in the middle position in an ordered set. | | [`android:state_pressed`](https://developer.android.com/reference/android/graphics/drawable/StateListDrawable#attr_android:state_pressed) | State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`, set when the user is pressing down in a view. | | [`android:state_selected`](https://developer.android.com/reference/android/graphics/drawable/StateListDrawable#attr_android:state_selected) | State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`, set when a view (or one of its parents) is currently selected. | | [`android:state_single`](https://developer.android.com/reference/android/graphics/drawable/StateListDrawable#attr_android:state_single) | State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`, set when a view or drawable is considered "single" by its host. | | [`android:state_window_focused`](https://developer.android.com/reference/android/graphics/drawable/StateListDrawable#attr_android:state_window_focused) | State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`, set when a view's window has input focus. | | [`android:variablePadding`](https://developer.android.com/reference/android/graphics/drawable/StateListDrawable#attr_android:variablePadding) | If true, allows the drawable's padding to change based on the current state that is selected. | | [`android:visible`](https://developer.android.com/reference/android/graphics/drawable/StateListDrawable#attr_android:visible) | Indicates whether the drawable should be initially visible. | ||

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/graphics/drawable/AnimatedStateListDrawable#AnimatedStateListDrawable()() ` |

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/graphics/drawable/AnimatedStateListDrawable#addState(int[],%20android.graphics.drawable.Drawable,%20int)(int[] stateSet, https://developer.android.com/reference/android/graphics/drawable/Drawable drawable, int id) ` Add a new drawable to the set of keyframes. |
| ` <T extends https://developer.android.com/reference/android/graphics/drawable/Drawable & https://developer.android.com/reference/android/graphics/drawable/Animatable> void` | ` https://developer.android.com/reference/android/graphics/drawable/AnimatedStateListDrawable#addTransition(int,%20int,%20T,%20boolean)(int fromId, int toId, T transition, boolean reversible) ` Adds a new transition between keyframes. |
| ` void` | ` https://developer.android.com/reference/android/graphics/drawable/AnimatedStateListDrawable#applyTheme(android.content.res.Resources.Theme)(https://developer.android.com/reference/android/content/res/Resources.Theme theme) ` Applies the specified theme to this Drawable and its children. |
| ` void` | ` https://developer.android.com/reference/android/graphics/drawable/AnimatedStateListDrawable#inflate(android.content.res.Resources,%20org.xmlpull.v1.XmlPullParser,%20android.util.AttributeSet,%20android.content.res.Resources.Theme)(https://developer.android.com/reference/android/content/res/Resources r, https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser parser, https://developer.android.com/reference/android/util/AttributeSet attrs, https://developer.android.com/reference/android/content/res/Resources.Theme theme) ` Inflate this Drawable from an XML resource optionally styled by a theme. |
| ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/AnimatedStateListDrawable#isStateful()() ` Indicates whether this drawable will change its appearance based on state. |
| ` void` | ` https://developer.android.com/reference/android/graphics/drawable/AnimatedStateListDrawable#jumpToCurrentState()() ` If this Drawable does transition animations between states, ask that it immediately jump to the current state and skip any active animations. |
| ` https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/graphics/drawable/AnimatedStateListDrawable#mutate()() ` Make this drawable mutable. |
| ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/AnimatedStateListDrawable#setVisible(boolean,%20boolean)(boolean visible, boolean restart) ` Set whether this Drawable is visible. |

| ### Protected methods ||
|---|---|
| ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/AnimatedStateListDrawable#onStateChange(int[])(int[] stateSet) ` Override this in your subclass to change appearance if you recognize the specified state. |
| ` void` | ` https://developer.android.com/reference/android/graphics/drawable/AnimatedStateListDrawable#setConstantState(android.graphics.drawable.DrawableContainer.DrawableContainerState)(https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.DrawableContainerState state) ` |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/android/graphics/drawable/StateListDrawable ` |---|---| | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/StateListDrawable#addState(int[],%20android.graphics.drawable.Drawable)(int[] stateSet, https://developer.android.com/reference/android/graphics/drawable/Drawable drawable) ` Add a new image/string ID to the set of images. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/StateListDrawable#applyTheme(android.content.res.Resources.Theme)(https://developer.android.com/reference/android/content/res/Resources.Theme theme) ` Applies the specified theme to this Drawable and its children. | | ` int` | ` https://developer.android.com/reference/android/graphics/drawable/StateListDrawable#findStateDrawableIndex(int[])(int[] stateSet) ` Gets the index of the drawable with the provided state set. | | ` int` | ` https://developer.android.com/reference/android/graphics/drawable/StateListDrawable#getStateCount()() ` Gets the number of states contained in this drawable. | | ` https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/graphics/drawable/StateListDrawable#getStateDrawable(int)(int index) ` Gets the drawable at an index. | | ` int[]` | ` https://developer.android.com/reference/android/graphics/drawable/StateListDrawable#getStateSet(int)(int index) ` Gets the state set at an index. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/StateListDrawable#hasFocusStateSpecified()() ` Indicates whether this drawable has at least one state spec explicitly specifying `https://developer.android.com/reference/android/R.attr#state_focused`. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/StateListDrawable#inflate(android.content.res.Resources,%20org.xmlpull.v1.XmlPullParser,%20android.util.AttributeSet,%20android.content.res.Resources.Theme)(https://developer.android.com/reference/android/content/res/Resources r, https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser parser, https://developer.android.com/reference/android/util/AttributeSet attrs, https://developer.android.com/reference/android/content/res/Resources.Theme theme) ` Inflate this Drawable from an XML resource optionally styled by a theme. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/StateListDrawable#isStateful()() ` Indicates whether this drawable will change its appearance based on state. | | ` https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/graphics/drawable/StateListDrawable#mutate()() ` Make this drawable mutable. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/StateListDrawable#onStateChange(int[])(int[] stateSet) ` Override this in your subclass to change appearance if you recognize the specified state. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/StateListDrawable#setConstantState(android.graphics.drawable.DrawableContainer.DrawableContainerState)(https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.DrawableContainerState state) ` | ||
| From class ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer ` |---|---| | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#applyTheme(android.content.res.Resources.Theme)(https://developer.android.com/reference/android/content/res/Resources.Theme theme) ` Applies the specified theme to this Drawable and its children. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#canApplyTheme()() ` | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#draw(android.graphics.Canvas)(https://developer.android.com/reference/android/graphics/Canvas canvas) ` Draw in its bounds (set via setBounds) respecting optional effects such as alpha (set via setAlpha) and color filter (set via setColorFilter). | | ` int` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#getAlpha()() ` Gets the current alpha value for the drawable. | | ` int` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#getChangingConfigurations()() ` Return a mask of the configuration parameters for which this drawable may change, requiring that it be re-created. | | ` https://developer.android.com/reference/android/graphics/drawable/Drawable.ConstantState` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#getConstantState()() ` Return a `https://developer.android.com/reference/android/graphics/drawable/Drawable.ConstantState` instance that holds the shared state of this Drawable. | | ` https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#getCurrent()() ` | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#getHotspotBounds(android.graphics.Rect)(https://developer.android.com/reference/android/graphics/Rect outRect) ` Populates `outRect` with the hotspot bounds. | | ` int` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#getIntrinsicHeight()() ` Returns the drawable's intrinsic height. | | ` int` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#getIntrinsicWidth()() ` Returns the drawable's intrinsic width. | | ` int` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#getMinimumHeight()() ` Returns the minimum height suggested by this Drawable. | | ` int` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#getMinimumWidth()() ` Returns the minimum width suggested by this Drawable. | | ` int` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#getOpacity()() ` *This method is deprecated. This method is no longer used in graphics optimizations* | | ` https://developer.android.com/reference/android/graphics/Insets` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#getOpticalInsets()() ` Return in insets the layout insets suggested by this Drawable for use with alignment operations during layout. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#getOutline(android.graphics.Outline)(https://developer.android.com/reference/android/graphics/Outline outline) ` Called to get the drawable to populate the Outline that defines its drawing area. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#getPadding(android.graphics.Rect)(https://developer.android.com/reference/android/graphics/Rect padding) ` Return in padding the insets suggested by this Drawable for placing content inside the drawable's bounds. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#hasFocusStateSpecified()() ` Indicates whether this drawable has at least one state spec explicitly specifying `https://developer.android.com/reference/android/R.attr#state_focused`. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#invalidateDrawable(android.graphics.drawable.Drawable)(https://developer.android.com/reference/android/graphics/drawable/Drawable who) ` Called when the drawable needs to be redrawn. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#isAutoMirrored()() ` Tells if this Drawable will be automatically mirrored when its layout direction is RTL right-to-left. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#isStateful()() ` Indicates whether this drawable will change its appearance based on state. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#jumpToCurrentState()() ` If this Drawable does transition animations between states, ask that it immediately jump to the current state and skip any active animations. | | ` https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#mutate()() ` Make this drawable mutable. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#onBoundsChange(android.graphics.Rect)(https://developer.android.com/reference/android/graphics/Rect bounds) ` Override this in your subclass to change appearance if you vary based on the bounds. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#onLayoutDirectionChanged(int)(int layoutDirection) ` Called when the drawable's resolved layout direction changes. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#onLevelChange(int)(int level) ` Override this in your subclass to change appearance if you vary based on level. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#onStateChange(int[])(int[] state) ` Override this in your subclass to change appearance if you recognize the specified state. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#scheduleDrawable(android.graphics.drawable.Drawable,%20java.lang.Runnable,%20long)(https://developer.android.com/reference/android/graphics/drawable/Drawable who, https://developer.android.com/reference/java/lang/Runnable what, long when) ` A Drawable can call this to schedule the next frame of its animation. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#selectDrawable(int)(int index) ` Sets the currently displayed drawable by index. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#setAlpha(int)(int alpha) ` Specify an alpha value for the drawable. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#setAutoMirrored(boolean)(boolean mirrored) ` Set whether this Drawable is automatically mirrored when its layout direction is RTL (right-to left). | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#setColorFilter(android.graphics.ColorFilter)(https://developer.android.com/reference/android/graphics/ColorFilter colorFilter) ` Specify an optional color filter for the drawable. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#setConstantState(android.graphics.drawable.DrawableContainer.DrawableContainerState)(https://developer.android.com/reference/android/graphics/drawable/DrawableContainer.DrawableContainerState state) ` | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#setDither(boolean)(boolean dither) ` Set to true to have the drawable dither its colors when drawn to a device with fewer than 8-bits per color component. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#setEnterFadeDuration(int)(int ms) ` Change the global fade duration when a new drawable is entering the scene. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#setExitFadeDuration(int)(int ms) ` Change the global fade duration when a new drawable is leaving the scene. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#setHotspot(float,%20float)(float x, float y) ` Specifies the hotspot's location within the drawable. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#setHotspotBounds(int,%20int,%20int,%20int)(int left, int top, int right, int bottom) ` Sets the bounds to which the hotspot is constrained, if they should be different from the drawable bounds. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#setTintBlendMode(android.graphics.BlendMode)(https://developer.android.com/reference/android/graphics/BlendMode blendMode) ` Specifies a tint blending mode for this drawable. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#setTintList(android.content.res.ColorStateList)(https://developer.android.com/reference/android/content/res/ColorStateList tint) ` Specifies tint color for this drawable as a color state list. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#setVisible(boolean,%20boolean)(boolean visible, boolean restart) ` Set whether this Drawable is visible. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/DrawableContainer#unscheduleDrawable(android.graphics.drawable.Drawable,%20java.lang.Runnable)(https://developer.android.com/reference/android/graphics/drawable/Drawable who, https://developer.android.com/reference/java/lang/Runnable what) ` A Drawable can call this to unschedule an action previously scheduled with `https://developer.android.com/reference/android/graphics/drawable/Drawable.Callback#scheduleDrawable(android.graphics.drawable.Drawable,%20java.lang.Runnable,%20long)`. | ||
| From class ` https://developer.android.com/reference/android/graphics/drawable/Drawable ` |---|---| | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#applyTheme(android.content.res.Resources.Theme)(https://developer.android.com/reference/android/content/res/Resources.Theme t) ` Applies the specified theme to this Drawable and its children. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#canApplyTheme()() ` | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#clearColorFilter()() ` Removes the color filter for this drawable. | | ` final https://developer.android.com/reference/android/graphics/Rect` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#copyBounds()() ` Return a copy of the drawable's bounds in a new Rect. | | ` final void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#copyBounds(android.graphics.Rect)(https://developer.android.com/reference/android/graphics/Rect bounds) ` Return a copy of the drawable's bounds in the specified Rect (allocated by the caller). | | ` static https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#createFromPath(java.lang.String)(https://developer.android.com/reference/java/lang/String pathName) ` Create a drawable from file path name. | | ` static https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#createFromResourceStream(android.content.res.Resources,%20android.util.TypedValue,%20java.io.InputStream,%20java.lang.String,%20android.graphics.BitmapFactory.Options)(https://developer.android.com/reference/android/content/res/Resources res, https://developer.android.com/reference/android/util/TypedValue value, https://developer.android.com/reference/java/io/InputStream is, https://developer.android.com/reference/java/lang/String srcName, https://developer.android.com/reference/android/graphics/BitmapFactory.Options opts) ` *This method was deprecated in API level 28. Prefer the version without an Options object.* | | ` static https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#createFromResourceStream(android.content.res.Resources,%20android.util.TypedValue,%20java.io.InputStream,%20java.lang.String)(https://developer.android.com/reference/android/content/res/Resources res, https://developer.android.com/reference/android/util/TypedValue value, https://developer.android.com/reference/java/io/InputStream is, https://developer.android.com/reference/java/lang/String srcName) ` Create a drawable from an inputstream, using the given resources and value to determine density information. | | ` static https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#createFromStream(java.io.InputStream,%20java.lang.String)(https://developer.android.com/reference/java/io/InputStream is, https://developer.android.com/reference/java/lang/String srcName) ` Create a drawable from an inputstream | | ` static https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#createFromXml(android.content.res.Resources,%20org.xmlpull.v1.XmlPullParser)(https://developer.android.com/reference/android/content/res/Resources r, https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser parser) ` Create a drawable from an XML document. | | ` static https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#createFromXml(android.content.res.Resources,%20org.xmlpull.v1.XmlPullParser,%20android.content.res.Resources.Theme)(https://developer.android.com/reference/android/content/res/Resources r, https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser parser, https://developer.android.com/reference/android/content/res/Resources.Theme theme) ` Create a drawable from an XML document using an optional `https://developer.android.com/reference/android/content/res/Resources.Theme`. | | ` static https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#createFromXmlInner(android.content.res.Resources,%20org.xmlpull.v1.XmlPullParser,%20android.util.AttributeSet,%20android.content.res.Resources.Theme)(https://developer.android.com/reference/android/content/res/Resources r, https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser parser, https://developer.android.com/reference/android/util/AttributeSet attrs, https://developer.android.com/reference/android/content/res/Resources.Theme theme) ` Create a drawable from inside an XML document using an optional `https://developer.android.com/reference/android/content/res/Resources.Theme`. | | ` static https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#createFromXmlInner(android.content.res.Resources,%20org.xmlpull.v1.XmlPullParser,%20android.util.AttributeSet)(https://developer.android.com/reference/android/content/res/Resources r, https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser parser, https://developer.android.com/reference/android/util/AttributeSet attrs) ` Create from inside an XML document. | | ` abstract void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#draw(android.graphics.Canvas)(https://developer.android.com/reference/android/graphics/Canvas canvas) ` Draw in its bounds (set via setBounds) respecting optional effects such as alpha (set via setAlpha) and color filter (set via setColorFilter). | | ` int` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#getAlpha()() ` Gets the current alpha value for the drawable. | | ` final https://developer.android.com/reference/android/graphics/Rect` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#getBounds()() ` Return the drawable's bounds Rect. | | ` https://developer.android.com/reference/android/graphics/drawable/Drawable.Callback` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#getCallback()() ` Return the current `https://developer.android.com/reference/android/graphics/drawable/Drawable.Callback` implementation attached to this Drawable. | | ` int` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#getChangingConfigurations()() ` Return a mask of the configuration parameters for which this drawable may change, requiring that it be re-created. | | ` https://developer.android.com/reference/android/graphics/ColorFilter` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#getColorFilter()() ` Returns the current color filter, or `null` if none set. | | ` https://developer.android.com/reference/android/graphics/drawable/Drawable.ConstantState` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#getConstantState()() ` Return a `https://developer.android.com/reference/android/graphics/drawable/Drawable.ConstantState` instance that holds the shared state of this Drawable. | | ` https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#getCurrent()() ` | | ` https://developer.android.com/reference/android/graphics/Rect` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#getDirtyBounds()() ` Return the drawable's dirty bounds Rect. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#getHotspotBounds(android.graphics.Rect)(https://developer.android.com/reference/android/graphics/Rect outRect) ` Populates `outRect` with the hotspot bounds. | | ` int` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#getIntrinsicHeight()() ` Returns the drawable's intrinsic height. | | ` int` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#getIntrinsicWidth()() ` Returns the drawable's intrinsic width. | | ` int` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#getLayoutDirection()() ` Returns the resolved layout direction for this Drawable. | | ` final int` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#getLevel()() ` Retrieve the current level. | | ` int` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#getMinimumHeight()() ` Returns the minimum height suggested by this Drawable. | | ` int` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#getMinimumWidth()() ` Returns the minimum width suggested by this Drawable. | | ` abstract int` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#getOpacity()() ` *This method was deprecated in API level 29. This method is no longer used in graphics optimizations* | | ` https://developer.android.com/reference/android/graphics/Insets` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#getOpticalInsets()() ` Return in insets the layout insets suggested by this Drawable for use with alignment operations during layout. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#getOutline(android.graphics.Outline)(https://developer.android.com/reference/android/graphics/Outline outline) ` Called to get the drawable to populate the Outline that defines its drawing area. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#getPadding(android.graphics.Rect)(https://developer.android.com/reference/android/graphics/Rect padding) ` Return in padding the insets suggested by this Drawable for placing content inside the drawable's bounds. | | ` int[]` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#getState()() ` Describes the current state, as a union of primitive states, such as `https://developer.android.com/reference/android/R.attr#state_focused`, `https://developer.android.com/reference/android/R.attr#state_selected`, etc. | | ` https://developer.android.com/reference/android/graphics/Region` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#getTransparentRegion()() ` Returns a Region representing the part of the Drawable that is completely transparent. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#hasFocusStateSpecified()() ` Indicates whether this drawable has at least one state spec explicitly specifying `https://developer.android.com/reference/android/R.attr#state_focused`. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#inflate(android.content.res.Resources,%20org.xmlpull.v1.XmlPullParser,%20android.util.AttributeSet,%20android.content.res.Resources.Theme)(https://developer.android.com/reference/android/content/res/Resources r, https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser parser, https://developer.android.com/reference/android/util/AttributeSet attrs, https://developer.android.com/reference/android/content/res/Resources.Theme theme) ` Inflate this Drawable from an XML resource optionally styled by a theme. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#inflate(android.content.res.Resources,%20org.xmlpull.v1.XmlPullParser,%20android.util.AttributeSet)(https://developer.android.com/reference/android/content/res/Resources r, https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser parser, https://developer.android.com/reference/android/util/AttributeSet attrs) ` Inflate this Drawable from an XML resource. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#invalidateSelf()() ` Use the current `https://developer.android.com/reference/android/graphics/drawable/Drawable.Callback` implementation to have this Drawable redrawn. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#isAutoMirrored()() ` Tells if this Drawable will be automatically mirrored when its layout direction is RTL right-to-left. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#isFilterBitmap()() ` | | ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#isProjected()() ` Whether this drawable requests projection. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#isStateful()() ` Indicates whether this drawable will change its appearance based on state. | | ` final boolean` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#isVisible()() ` | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#jumpToCurrentState()() ` If this Drawable does transition animations between states, ask that it immediately jump to the current state and skip any active animations. | | ` https://developer.android.com/reference/android/graphics/drawable/Drawable` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#mutate()() ` Make this drawable mutable. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#onBoundsChange(android.graphics.Rect)(https://developer.android.com/reference/android/graphics/Rect bounds) ` Override this in your subclass to change appearance if you vary based on the bounds. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#onLayoutDirectionChanged(int)(int layoutDirection) ` Called when the drawable's resolved layout direction changes. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#onLevelChange(int)(int level) ` Override this in your subclass to change appearance if you vary based on level. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#onStateChange(int[])(int[] state) ` Override this in your subclass to change appearance if you recognize the specified state. | | ` static int` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#resolveOpacity(int,%20int)(int op1, int op2) ` Return the appropriate opacity value for two source opacities. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#scheduleSelf(java.lang.Runnable,%20long)(https://developer.android.com/reference/java/lang/Runnable what, long when) ` Use the current `https://developer.android.com/reference/android/graphics/drawable/Drawable.Callback` implementation to have this Drawable scheduled. | | ` abstract void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#setAlpha(int)(int alpha) ` Specify an alpha value for the drawable. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#setAutoMirrored(boolean)(boolean mirrored) ` Set whether this Drawable is automatically mirrored when its layout direction is RTL (right-to left). | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#setBounds(int,%20int,%20int,%20int)(int left, int top, int right, int bottom) ` Specify a bounding rectangle for the Drawable. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#setBounds(android.graphics.Rect)(https://developer.android.com/reference/android/graphics/Rect bounds) ` Specify a bounding rectangle for the Drawable. | | ` final void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#setCallback(android.graphics.drawable.Drawable.Callback)(https://developer.android.com/reference/android/graphics/drawable/Drawable.Callback cb) ` Bind a `https://developer.android.com/reference/android/graphics/drawable/Drawable.Callback` object to this Drawable. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#setChangingConfigurations(int)(int configs) ` Set a mask of the configuration parameters for which this drawable may change, requiring that it be re-created. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#setColorFilter(int,%20android.graphics.PorterDuff.Mode)(int color, https://developer.android.com/reference/android/graphics/PorterDuff.Mode mode) ` *This method was deprecated in API level 29. use `https://developer.android.com/reference/android/graphics/drawable/Drawable#setColorFilter(android.graphics.ColorFilter)` with an instance of `https://developer.android.com/reference/android/graphics/BlendModeColorFilter`* | | ` abstract void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#setColorFilter(android.graphics.ColorFilter)(https://developer.android.com/reference/android/graphics/ColorFilter colorFilter) ` Specify an optional color filter for the drawable. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#setDither(boolean)(boolean dither) ` Set to true to have the drawable dither its colors when drawn to a device with fewer than 8-bits per color component. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#setFilterBitmap(boolean)(boolean filter) ` Set to true to have the drawable filter its bitmaps with bilinear sampling when they are scaled or rotated. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#setHotspot(float,%20float)(float x, float y) ` Specifies the hotspot's location within the drawable. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#setHotspotBounds(int,%20int,%20int,%20int)(int left, int top, int right, int bottom) ` Sets the bounds to which the hotspot is constrained, if they should be different from the drawable bounds. | | ` final boolean` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#setLayoutDirection(int)(int layoutDirection) ` Set the layout direction for this drawable. | | ` final boolean` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#setLevel(int)(int level) ` Specify the level for the drawable. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#setState(int[])(int[] stateSet) ` Specify a set of states for the drawable. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#setTint(int)(int tintColor) ` Specifies tint color for this drawable. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#setTintBlendMode(android.graphics.BlendMode)(https://developer.android.com/reference/android/graphics/BlendMode blendMode) ` Specifies a tint blending mode for this drawable. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#setTintList(android.content.res.ColorStateList)(https://developer.android.com/reference/android/content/res/ColorStateList tint) ` Specifies tint color for this drawable as a color state list. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#setTintMode(android.graphics.PorterDuff.Mode)(https://developer.android.com/reference/android/graphics/PorterDuff.Mode tintMode) ` Specifies a tint blending mode for this drawable. | | ` boolean` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#setVisible(boolean,%20boolean)(boolean visible, boolean restart) ` Set whether this Drawable is visible. | | ` void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable#unscheduleSelf(java.lang.Runnable)(https://developer.android.com/reference/java/lang/Runnable what) ` Use the current `https://developer.android.com/reference/android/graphics/drawable/Drawable.Callback` implementation to have this Drawable unscheduled. | ||
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||
| From interface ` https://developer.android.com/reference/android/graphics/drawable/Drawable.Callback ` |---|---| | ` abstract void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable.Callback#invalidateDrawable(android.graphics.drawable.Drawable)(https://developer.android.com/reference/android/graphics/drawable/Drawable who) ` Called when the drawable needs to be redrawn. | | ` abstract void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable.Callback#scheduleDrawable(android.graphics.drawable.Drawable,%20java.lang.Runnable,%20long)(https://developer.android.com/reference/android/graphics/drawable/Drawable who, https://developer.android.com/reference/java/lang/Runnable what, long when) ` A Drawable can call this to schedule the next frame of its animation. | | ` abstract void` | ` https://developer.android.com/reference/android/graphics/drawable/Drawable.Callback#unscheduleDrawable(android.graphics.drawable.Drawable,%20java.lang.Runnable)(https://developer.android.com/reference/android/graphics/drawable/Drawable who, https://developer.android.com/reference/java/lang/Runnable what) ` A Drawable can call this to unschedule an action previously scheduled with `https://developer.android.com/reference/android/graphics/drawable/Drawable.Callback#scheduleDrawable(android.graphics.drawable.Drawable,%20java.lang.Runnable,%20long)`. | ||

## XML attributes

### android:state_activated

State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`,
set when a view or its parent has been "activated" meaning the user has currently
marked it as being of interest. This is an alternative representation of
state_checked for when the state should be propagated down the view hierarchy.

May be a boolean value, such as "`true`" or
"`false`".

<br />

### android:state_active

State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`,
set when a view or drawable is considered "active" by its host. Actual usage may vary
between views. Consult the host view documentation for details.

May be a boolean value, such as "`true`" or
"`false`".

<br />

### android:state_checkable

State identifier indicating that the object <var translate="no">may</var> display a check mark. See
`https://developer.android.com/reference/android/R.attr#state_checked` for the identifier that indicates whether it is
actually checked.

May be a boolean value, such as "`true`" or
"`false`".

<br />

### android:state_checked

State identifier indicating that the object is currently checked. See
`https://developer.android.com/reference/android/R.attr#state_checkable` for an additional identifier that can indicate
if any object may ever display a check, regardless of whether state_checked is
currently set.

May be a boolean value, such as "`true`" or
"`false`".

<br />

### android:state_enabled

State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`,
set when a view is enabled.

May be a boolean value, such as "`true`" or
"`false`".

<br />

### android:state_first

State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`,
set when a view or drawable is in the first position in an ordered set. Actual usage
may vary between views. Consult the host view documentation for details.

May be a boolean value, such as "`true`" or
"`false`".

<br />

### android:state_focused

State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`,
set when a view has input focus.

May be a boolean value, such as "`true`" or
"`false`".

<br />

### android:state_last

State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`,
set when a view or drawable is in the last position in an ordered set. Actual usage
may vary between views. Consult the host view documentation for details.

May be a boolean value, such as "`true`" or
"`false`".

<br />

### android:state_middle

State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`,
set when a view or drawable is in the middle position in an ordered set. Actual usage
may vary between views. Consult the host view documentation for details.

May be a boolean value, such as "`true`" or
"`false`".

<br />

### android:state_pressed

State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`,
set when the user is pressing down in a view.

May be a boolean value, such as "`true`" or
"`false`".

<br />

### android:state_selected

State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`,
set when a view (or one of its parents) is currently selected.

May be a boolean value, such as "`true`" or
"`false`".

<br />

### android:state_single

State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`,
set when a view or drawable is considered "single" by its host. Actual usage may vary
between views. Consult the host view documentation for details.

May be a boolean value, such as "`true`" or
"`false`".

<br />

### android:state_window_focused

State value for `https://developer.android.com/reference/android/graphics/drawable/StateListDrawable`,
set when a view's window has input focus.

May be a boolean value, such as "`true`" or
"`false`".

<br />

## Public constructors

### AnimatedStateListDrawable

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public AnimatedStateListDrawable ()
```

<br />

<br />

## Public methods

### addState

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void addState (int[] stateSet, 
                Drawable drawable, 
                int id)
```

Add a new drawable to the set of keyframes.

<br />

| Parameters ||
|---|---|
| `stateSet` | `int`: An array of resource IDs to associate with the keyframe. This value cannot be `null`. <br /> |
| `drawable` | `Drawable`: The drawable to show when in the specified state, may not be null <br /> |
| `id` | `int`: The unique identifier for the keyframe <br /> |

### addTransition

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void addTransition (int fromId, 
                int toId, 
                T transition, 
                boolean reversible)
```

Adds a new transition between keyframes.

<br />

| Parameters ||
|---|---|
| `fromId` | `int`: Unique identifier of the starting keyframe <br /> |
| `toId` | `int`: Unique identifier of the ending keyframe <br /> |
| `transition` | `T`: An `https://developer.android.com/reference/android/graphics/drawable/Animatable` drawable to use as a transition, may not be null <br /> |
| `reversible` | `boolean`: Whether the transition can be reversed <br /> |

### applyTheme

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void applyTheme (Resources.Theme theme)
```

Applies the specified theme to this Drawable and its children.

<br />

| Parameters ||
|---|---|
| `theme` | `Resources.Theme`: This value may be `null`. <br /> |

### inflate

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void inflate (Resources r, 
                XmlPullParser parser, 
                AttributeSet attrs, 
                Resources.Theme theme)
```

Inflate this Drawable from an XML resource optionally styled by a theme.
This can't be called more than once for each Drawable. Note that framework may have called
this once to create the Drawable instance from XML resource.

<br />

| Parameters ||
|---|---|
| `r` | `Resources`: This value cannot be `null`. <br /> |
| `parser` | `XmlPullParser`: This value cannot be `null`. <br /> |
| `attrs` | `AttributeSet`: This value cannot be `null`. <br /> |
| `theme` | `Resources.Theme`: This value may be `null`. <br /> |

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

### isStateful

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isStateful ()
```

Indicates whether this drawable will change its appearance based on
state. Clients can use this to determine whether it is necessary to
calculate their state and call setState.

<br />

| Returns ||
|---|---|
| `boolean` | True if this drawable changes its appearance based on state, false otherwise. <br /> |

### jumpToCurrentState

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void jumpToCurrentState ()
```

If this Drawable does transition animations between states, ask that
it immediately jump to the current state and skip any active animations.

<br />

### mutate

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Drawable mutate ()
```

Make this drawable mutable. This operation cannot be reversed. A mutable
drawable is guaranteed to not share its state with any other drawable.
This is especially useful when you need to modify properties of drawables
loaded from resources. By default, all drawables instances loaded from
the same resource share a common state; if you modify the state of one
instance, all the other instances will receive the same modification.

Calling this method on a mutable Drawable will have no effect.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/drawable/Drawable` | This drawable. This value cannot be `null`. <br /> |

### setVisible

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

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

Set whether this Drawable is visible. This generally does not impact
the Drawable's behavior, but is a hint that can be used by some
Drawables, for example, to decide whether run animations.

<br />

| Parameters ||
|---|---|
| `visible` | `boolean`: Set to true if visible, false if not. <br /> |
| `restart` | `boolean`: You can supply true here to force the drawable to behave as if it has just become visible, even if it had last been set visible. Used for example to force animations to restart. <br /> |

| Returns ||
|---|---|
| `boolean` | boolean Returns true if the new visibility is different than its previous state. <br /> |

## Protected methods

### onStateChange

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
protected boolean onStateChange (int[] stateSet)
```

Override this in your subclass to change appearance if you recognize the
specified state.

<br />

| Parameters ||
|---|---|
| `stateSet` | `int`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `boolean` | Returns true if the state change has caused the appearance of the Drawable to change (that is, it needs to be drawn), else false if it looks the same and there is no need to redraw it since its last state. <br /> |

### setConstantState

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
protected void setConstantState (DrawableContainer.DrawableContainerState state)
```

<br />

<br />

| Parameters ||
|---|---|
| `state` | `DrawableContainer.DrawableContainerState`: This value cannot be `null`. <br /> |