Skip to content

Commit 19b1c12

Browse files
scottamainAndroid (Google) Code Review
authored andcommitted
Merge "Docs: update state list drawable with state_activated and revise selected/focused" into ics-mr0
2 parents f1f0c87 + 75eaae7 commit 19b1c12

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

docs/html/guide/topics/resources/drawable-resource.jd

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,7 @@ In XML: <code>@[<em>package</em>:]drawable/<em>filename</em></code>
646646
android:state_checkable=["true" | "false"]
647647
android:state_checked=["true" | "false"]
648648
android:state_enabled=["true" | "false"]
649+
android:state_activated=["true" | "false"]
649650
android:state_window_focused=["true" | "false"] />
650651
&lt;/selector>
651652
</pre>
@@ -690,17 +691,20 @@ child of a <code>&lt;selector&gt;</code> element.
690691
<dd><em>Boolean</em>. "true" if this item should be used when the object is pressed (such as when a button
691692
is touched/clicked); "false" if this item should be used in the default, non-pressed state.</dd>
692693
<dt><code>android:state_focused</code></dt>
693-
<dd><em>Boolean</em>. "true" if this item should be used when the object is focused (such as when a button
694-
is highlighted using the trackball/d-pad); "false" if this item should be used in the default,
694+
<dd><em>Boolean</em>. "true" if this item should be used when the object has input focus
695+
(such as when the user selects a text input); "false" if this item should be used in the default,
695696
non-focused state.</dd>
696697
<dt><code>android:state_hovered</code></dt>
697698
<dd><em>Boolean</em>. "true" if this item should be used when the object is being hovered
698699
by a cursor; "false" if this item should be used in the default, non-hovered state. Often, this
699700
drawable may be the same drawable used for the "focused" state.
700701
<p>Introduced in API level 14.</p></dd>
701702
<dt><code>android:state_selected</code></dt>
702-
<dd><em>Boolean</em>. "true" if this item should be used when the object is selected (such as when a
703-
tab is opened); "false" if this item should be used when the object is not selected.</dd>
703+
<dd><em>Boolean</em>. "true" if this item should be used when the object is the current
704+
user selection when navigating with a directional control (such as when navigating through a list
705+
with a d-pad); "false" if this item should be used when the object is not selected.
706+
<p>The selected state is used when focus (<code>android:state_focused</code>) is not sufficient
707+
(such as when list view has focus and an item within it is selected with a d-pad).</p></dd>
704708
<dt><code>android:state_checkable</code></dt>
705709
<dd><em>Boolean</em>. "true" if this item should be used when the object is checkable; "false" if this
706710
item should be used when the object is not checkable. (Only useful if the object can
@@ -709,8 +713,14 @@ transition between a checkable and non-checkable widget.)</dd>
709713
<dd><em>Boolean</em>. "true" if this item should be used when the object is checked; "false" if it
710714
should be used when the object is un-checked.</dd>
711715
<dt><code>android:state_enabled</code></dt>
712-
<dd><em>Boolean</em>. "true" if this item should be used when the object is enabled (capable of
713-
receiving touch/click events); "false" if it should be used when the object is disabled.</dd>
716+
<dd><em>Boolean</em>. "true" if this item should be used when the object is enabled
717+
(capable of receiving touch/click events); "false" if it should be used when the object is
718+
disabled.</dd>
719+
<dt><code>android:state_activated</code></dt>
720+
<dd><em>Boolean</em>. "true" if this item should be used when the object is activated as
721+
the persistent selection (such as to "highlight" the previously selected list item in a persistent
722+
navigation view); "false" if it should be used when the object is not activated.
723+
<p>Introduced in API level 11.</p></dd>
714724
<dt><code>android:state_window_focused</code></dt>
715725
<dd><em>Boolean</em>. "true" if this item should be used when the application window has focus (the
716726
application is in the foreground), "false" if this item should be used when the application

0 commit comments

Comments
 (0)