Added in API level 21

AnimatedStateListDrawable


open class AnimatedStateListDrawable : StateListDrawable
kotlin.Any
   ↳ android.graphics.drawable.Drawable
   ↳ android.graphics.drawable.DrawableContainer
   ↳ android.graphics.drawable.StateListDrawable
   ↳ android.graphics.drawable.AnimatedStateListDrawable

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 State value for 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 State value for StateListDrawable , set when a view or drawable is considered "active" by its host.
android:state_checkable State identifier indicating that the object may display a check mark.
android:state_checked State identifier indicating that the object is currently checked.
android:state_enabled State value for StateListDrawable , set when a view is enabled.
android:state_first State value for StateListDrawable , set when a view or drawable is in the first position in an ordered set.
android:state_focused State value for StateListDrawable , set when a view has input focus.
android:state_last State value for StateListDrawable , set when a view or drawable is in the last position in an ordered set.
android:state_middle State value for StateListDrawable , set when a view or drawable is in the middle position in an ordered set.
android:state_pressed State value for StateListDrawable , set when the user is pressing down in a view.
android:state_selected State value for StateListDrawable , set when a view (or one of its parents) is currently selected.
android:state_single State value for StateListDrawable , set when a view or drawable is considered "single" by its host.
android:state_window_focused State value for StateListDrawable , set when a view's window has input focus.
Inherited XML attributes
Public constructors

Public methods
open Unit
addState(stateSet: IntArray, drawable: Drawable, id: Int)

Add a new drawable to the set of keyframes.

open Unit
addTransition(fromId: Int, toId: Int, transition: T, reversible: Boolean)

Adds a new transition between keyframes.

open Unit

Applies the specified theme to this Drawable and its children.

open Unit
inflate(r: Resources, parser: XmlPullParser, attrs: AttributeSet, theme: Resources.Theme?)

Inflate this Drawable from an XML resource optionally styled by a theme.

open Boolean

Indicates whether this drawable will change its appearance based on state.

open Unit

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

open Drawable

Make this drawable mutable.

open Boolean
setVisible(visible: Boolean, restart: Boolean)

Set whether this Drawable is visible.

Protected methods
open Boolean

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

open Unit

Inherited functions