java.lang.Object | |
↳ | android.animation.StateListAnimator |
Lets you define a number of Animators that will run on the attached View depending on the View's drawable state.
It can be defined in an XML file with the <selector>
element.
Each State Animator is defined in a nested <item>
element.
XML Attributes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
android:animation | Animation to use on each child. | ||||||||||
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 .
|
||||||||||
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 .
|
||||||||||
android:state_focused |
State value for StateListDrawable ,
set when a view has input focus.
|
||||||||||
android:state_last |
State value for StateListDrawable .
|
||||||||||
android:state_middle |
State value for StateListDrawable .
|
||||||||||
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 .
|
||||||||||
android:state_window_focused |
State value for StateListDrawable ,
set when a view's window has input focus.
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Associates the given animator with the provided drawable state specs so that it will be run
when the View's drawable state matches the specs.
| |||||||||||
Creates and returns a copy of this
Object .
| |||||||||||
If there is an animation running for a recent state change, ends it.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Animation to use on each child.
Must be a reference to another resource, in the form "@[+][package:]type:name
"
or to a theme attribute in the form "?[package:][type:]name
".
This corresponds to the global attribute
resource symbol animation
.
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. This is an alternative representation of
state_checked for when the state should be propagated down the view hierarchy.
Must be a boolean value, either "true
" or "false
".
This may also be a reference to a resource (in the form
"@[package:]type:name
") or
theme attribute (in the form
"?[package:][type:]name
")
containing a value of this type.
This corresponds to the global attribute
resource symbol state_activated
.
State value for StateListDrawable
.
Must be a boolean value, either "true
" or "false
".
This may also be a reference to a resource (in the form
"@[package:]type:name
") or
theme attribute (in the form
"?[package:][type:]name
")
containing a value of this type.
This corresponds to the global attribute
resource symbol state_active
.
State identifier indicating that the object may display a check mark.
See state_checked
for the identifier that indicates whether it is
actually checked.
Must be a boolean value, either "true
" or "false
".
This may also be a reference to a resource (in the form
"@[package:]type:name
") or
theme attribute (in the form
"?[package:][type:]name
")
containing a value of this type.
This corresponds to the global attribute
resource symbol state_checkable
.
State identifier indicating that the object is currently checked. See
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.
Must be a boolean value, either "true
" or "false
".
This may also be a reference to a resource (in the form
"@[package:]type:name
") or
theme attribute (in the form
"?[package:][type:]name
")
containing a value of this type.
This corresponds to the global attribute
resource symbol state_checked
.
State value for StateListDrawable
,
set when a view is enabled.
Must be a boolean value, either "true
" or "false
".
This may also be a reference to a resource (in the form
"@[package:]type:name
") or
theme attribute (in the form
"?[package:][type:]name
")
containing a value of this type.
This corresponds to the global attribute
resource symbol state_enabled
.
State value for StateListDrawable
.
Must be a boolean value, either "true
" or "false
".
This may also be a reference to a resource (in the form
"@[package:]type:name
") or
theme attribute (in the form
"?[package:][type:]name
")
containing a value of this type.
This corresponds to the global attribute
resource symbol state_first
.
State value for StateListDrawable
,
set when a view has input focus.
Must be a boolean value, either "true
" or "false
".
This may also be a reference to a resource (in the form
"@[package:]type:name
") or
theme attribute (in the form
"?[package:][type:]name
")
containing a value of this type.
This corresponds to the global attribute
resource symbol state_focused
.
State value for StateListDrawable
.
Must be a boolean value, either "true
" or "false
".
This may also be a reference to a resource (in the form
"@[package:]type:name
") or
theme attribute (in the form
"?[package:][type:]name
")
containing a value of this type.
This corresponds to the global attribute
resource symbol state_last
.
State value for StateListDrawable
.
Must be a boolean value, either "true
" or "false
".
This may also be a reference to a resource (in the form
"@[package:]type:name
") or
theme attribute (in the form
"?[package:][type:]name
")
containing a value of this type.
This corresponds to the global attribute
resource symbol state_middle
.
State value for StateListDrawable
,
set when the user is pressing down in a view.
Must be a boolean value, either "true
" or "false
".
This may also be a reference to a resource (in the form
"@[package:]type:name
") or
theme attribute (in the form
"?[package:][type:]name
")
containing a value of this type.
This corresponds to the global attribute
resource symbol state_pressed
.
State value for StateListDrawable
,
set when a view (or one of its parents) is currently selected.
Must be a boolean value, either "true
" or "false
".
This may also be a reference to a resource (in the form
"@[package:]type:name
") or
theme attribute (in the form
"?[package:][type:]name
")
containing a value of this type.
This corresponds to the global attribute
resource symbol state_selected
.
State value for StateListDrawable
.
Must be a boolean value, either "true
" or "false
".
This may also be a reference to a resource (in the form
"@[package:]type:name
") or
theme attribute (in the form
"?[package:][type:]name
")
containing a value of this type.
This corresponds to the global attribute
resource symbol state_single
.
State value for StateListDrawable
,
set when a view's window has input focus.
Must be a boolean value, either "true
" or "false
".
This may also be a reference to a resource (in the form
"@[package:]type:name
") or
theme attribute (in the form
"?[package:][type:]name
")
containing a value of this type.
This corresponds to the global attribute
resource symbol state_window_focused
.
Associates the given animator with the provided drawable state specs so that it will be run when the View's drawable state matches the specs.
specs | The drawable state specs to match against |
---|---|
animator | The animator to run when the specs match |
Creates and returns a copy of this Object
. The default
implementation returns a so-called "shallow" copy: It creates a new
instance of the same class and then copies the field values (including
object references) from this instance to the new instance. A "deep" copy,
in contrast, would also recursively clone nested objects. A subclass that
needs to implement this kind of cloning should call super.clone()
to create the new instance and then create deep copies of the nested,
mutable objects.
If there is an animation running for a recent state change, ends it.
This causes the animation to assign the end value(s) to the View.