Loading docs/html/guide/topics/resources/drawable-resource.jd +8 −0 Original line number Original line Diff line number Diff line Loading @@ -641,6 +641,7 @@ In XML: <code>@[<em>package</em>:]drawable/<em>filename</em></code> android:drawable="@[package:]drawable/<em>drawable_resource</em>" android:drawable="@[package:]drawable/<em>drawable_resource</em>" android:state_pressed=["true" | "false"] android:state_pressed=["true" | "false"] android:state_focused=["true" | "false"] android:state_focused=["true" | "false"] android:state_hovered=["true" | "false"] android:state_selected=["true" | "false"] android:state_selected=["true" | "false"] android:state_checkable=["true" | "false"] android:state_checkable=["true" | "false"] android:state_checked=["true" | "false"] android:state_checked=["true" | "false"] Loading Loading @@ -692,6 +693,11 @@ is touched/clicked); "false" if this item should be used in the default, non-pre <dd><em>Boolean</em>. "true" if this item should be used when the object is focused (such as when a button <dd><em>Boolean</em>. "true" if this item should be used when the object is focused (such as when a button is highlighted using the trackball/d-pad); "false" if this item should be used in the default, is highlighted using the trackball/d-pad); "false" if this item should be used in the default, non-focused state.</dd> non-focused state.</dd> <dt><code>android:state_hovered</code></dt> <dd><em>Boolean</em>. "true" if this item should be used when the object is being hovered by a cursor; "false" if this item should be used in the default, non-hovered state. Often, this drawable may be the same drawable used for the "focused" state. <p>Introduced in API level 14.</p></dd> <dt><code>android:state_selected</code></dt> <dt><code>android:state_selected</code></dt> <dd><em>Boolean</em>. "true" if this item should be used when the object is selected (such as when a <dd><em>Boolean</em>. "true" if this item should be used when the object is selected (such as when a tab is opened); "false" if this item should be used when the object is not selected.</dd> tab is opened); "false" if this item should be used when the object is not selected.</dd> Loading Loading @@ -729,6 +735,8 @@ default value should always be last (as demonstrated in the following example).< android:drawable="@drawable/button_pressed" /> <!-- pressed --> android:drawable="@drawable/button_pressed" /> <!-- pressed --> <item android:state_focused="true" <item android:state_focused="true" android:drawable="@drawable/button_focused" /> <!-- focused --> android:drawable="@drawable/button_focused" /> <!-- focused --> <item android:state_hovered="true" android:drawable="@drawable/button_focused" /> <!-- hovered --> <item android:drawable="@drawable/button_normal" /> <!-- default --> <item android:drawable="@drawable/button_normal" /> <!-- default --> </selector> </selector> </pre> </pre> Loading docs/html/guide/topics/resources/menu-resource.jd +19 −3 Original line number Original line Diff line number Diff line Loading @@ -43,9 +43,10 @@ In XML: <code>@[<em>package</em>:]menu.<em>filename</em></code> android:titleCondensed="<em>string</em>" android:titleCondensed="<em>string</em>" android:icon="@[package:]drawable/<em>drawable_resource_name</em>" android:icon="@[package:]drawable/<em>drawable_resource_name</em>" android:onClick="<em>method name</em>" android:onClick="<em>method name</em>" android:showAsAction=["ifRoom" | "never" | "withText" | "always"] android:showAsAction=["ifRoom" | "never" | "withText" | "always" | "collapseActionView"] android:actionLayout="@[package:]layout/<em>layout_resource_name</em>" android:actionLayout="@[package:]layout/<em>layout_resource_name</em>" android:actionViewClass="<em>class name</em>" android:actionViewClass="<em>class name</em>" android:actionProviderClass="<em>class name</em>" android:alphabeticShortcut="<em>string</em>" android:alphabeticShortcut="<em>string</em>" android:numericShortcut="<em>string</em>" android:numericShortcut="<em>string</em>" android:checkable=["true" | "false"] android:checkable=["true" | "false"] Loading Loading @@ -131,6 +132,9 @@ of the others as a flag set, by separating them with a pipe {@code |}.</td></tr> Avoid using this unless it's critical that the item always appear in the action Avoid using this unless it's critical that the item always appear in the action bar. Setting multiple items to always appear as action items can result in them overlapping bar. Setting multiple items to always appear as action items can result in them overlapping with other UI in the action bar.</td></tr> with other UI in the action bar.</td></tr> <tr><td><code>collapseActionView</code></td><td>The action view associated with this action item (as declared by <code>android:actionViewLayout</code>) is collapsible.<br/>Introduced in API Level 14.</td></tr> </table> </table> <p>See the <a href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> developer <p>See the <a href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> developer guide for more information.</p> guide for more information.</p> Loading @@ -143,9 +147,10 @@ guide for more information.</p> guide for more information.</p> guide for more information.</p> <p>Introduced in API Level 11.</p></dd> <p>Introduced in API Level 11.</p></dd> <dt><code>android:actionViewClassName</code></dt> <dt><code>android:actionViewClass</code></dt> <dd><em>Class name</em>. A fully-qualified class name for the {@link android.view.View} <dd><em>Class name</em>. A fully-qualified class name for the {@link android.view.View} to use as the action view. to use as the action view. For example, {@code "android.widget.SearchView"} to use {@link android.widget.SearchView} as an action view. <p>See the <a href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> developer <p>See the <a href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> developer guide for more information.</p> guide for more information.</p> <p class="warning"><strong>Warning:</strong> If you obfuscate your code using <a <p class="warning"><strong>Warning:</strong> If you obfuscate your code using <a Loading @@ -154,6 +159,17 @@ be sure to exclude the class you specify in this attribute from renaming, becaus functionality.</p> functionality.</p> <p>Introduced in API Level 11.</p></dd> <p>Introduced in API Level 11.</p></dd> <dt><code>android:actionProviderClass</code></dt> <dd><em>Class name</em>. A fully-qualified class name for the {@link android.view.ActionProvider} to use in place of the action item. For example, {@code "android.widget.ShareActionProvider"} to use {@link android.widget.ShareActionProvider}. <p>See the <a href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> developer guide for more information.</p> <p class="warning"><strong>Warning:</strong> If you obfuscate your code using <a href="{@docRoot}guide/developing/tools/proguard.html">ProGuard</a> (or a similar tool), be sure to exclude the class you specify in this attribute from renaming, because it can break the functionality.</p> <p>Introduced in API Level 14.</p></dd> <dt><code>android:alphabeticShortcut</code></dt> <dt><code>android:alphabeticShortcut</code></dt> <dd><em>Char</em>. A character for the alphabetic shortcut key.</dd> <dd><em>Char</em>. A character for the alphabetic shortcut key.</dd> Loading Loading
docs/html/guide/topics/resources/drawable-resource.jd +8 −0 Original line number Original line Diff line number Diff line Loading @@ -641,6 +641,7 @@ In XML: <code>@[<em>package</em>:]drawable/<em>filename</em></code> android:drawable="@[package:]drawable/<em>drawable_resource</em>" android:drawable="@[package:]drawable/<em>drawable_resource</em>" android:state_pressed=["true" | "false"] android:state_pressed=["true" | "false"] android:state_focused=["true" | "false"] android:state_focused=["true" | "false"] android:state_hovered=["true" | "false"] android:state_selected=["true" | "false"] android:state_selected=["true" | "false"] android:state_checkable=["true" | "false"] android:state_checkable=["true" | "false"] android:state_checked=["true" | "false"] android:state_checked=["true" | "false"] Loading Loading @@ -692,6 +693,11 @@ is touched/clicked); "false" if this item should be used in the default, non-pre <dd><em>Boolean</em>. "true" if this item should be used when the object is focused (such as when a button <dd><em>Boolean</em>. "true" if this item should be used when the object is focused (such as when a button is highlighted using the trackball/d-pad); "false" if this item should be used in the default, is highlighted using the trackball/d-pad); "false" if this item should be used in the default, non-focused state.</dd> non-focused state.</dd> <dt><code>android:state_hovered</code></dt> <dd><em>Boolean</em>. "true" if this item should be used when the object is being hovered by a cursor; "false" if this item should be used in the default, non-hovered state. Often, this drawable may be the same drawable used for the "focused" state. <p>Introduced in API level 14.</p></dd> <dt><code>android:state_selected</code></dt> <dt><code>android:state_selected</code></dt> <dd><em>Boolean</em>. "true" if this item should be used when the object is selected (such as when a <dd><em>Boolean</em>. "true" if this item should be used when the object is selected (such as when a tab is opened); "false" if this item should be used when the object is not selected.</dd> tab is opened); "false" if this item should be used when the object is not selected.</dd> Loading Loading @@ -729,6 +735,8 @@ default value should always be last (as demonstrated in the following example).< android:drawable="@drawable/button_pressed" /> <!-- pressed --> android:drawable="@drawable/button_pressed" /> <!-- pressed --> <item android:state_focused="true" <item android:state_focused="true" android:drawable="@drawable/button_focused" /> <!-- focused --> android:drawable="@drawable/button_focused" /> <!-- focused --> <item android:state_hovered="true" android:drawable="@drawable/button_focused" /> <!-- hovered --> <item android:drawable="@drawable/button_normal" /> <!-- default --> <item android:drawable="@drawable/button_normal" /> <!-- default --> </selector> </selector> </pre> </pre> Loading
docs/html/guide/topics/resources/menu-resource.jd +19 −3 Original line number Original line Diff line number Diff line Loading @@ -43,9 +43,10 @@ In XML: <code>@[<em>package</em>:]menu.<em>filename</em></code> android:titleCondensed="<em>string</em>" android:titleCondensed="<em>string</em>" android:icon="@[package:]drawable/<em>drawable_resource_name</em>" android:icon="@[package:]drawable/<em>drawable_resource_name</em>" android:onClick="<em>method name</em>" android:onClick="<em>method name</em>" android:showAsAction=["ifRoom" | "never" | "withText" | "always"] android:showAsAction=["ifRoom" | "never" | "withText" | "always" | "collapseActionView"] android:actionLayout="@[package:]layout/<em>layout_resource_name</em>" android:actionLayout="@[package:]layout/<em>layout_resource_name</em>" android:actionViewClass="<em>class name</em>" android:actionViewClass="<em>class name</em>" android:actionProviderClass="<em>class name</em>" android:alphabeticShortcut="<em>string</em>" android:alphabeticShortcut="<em>string</em>" android:numericShortcut="<em>string</em>" android:numericShortcut="<em>string</em>" android:checkable=["true" | "false"] android:checkable=["true" | "false"] Loading Loading @@ -131,6 +132,9 @@ of the others as a flag set, by separating them with a pipe {@code |}.</td></tr> Avoid using this unless it's critical that the item always appear in the action Avoid using this unless it's critical that the item always appear in the action bar. Setting multiple items to always appear as action items can result in them overlapping bar. Setting multiple items to always appear as action items can result in them overlapping with other UI in the action bar.</td></tr> with other UI in the action bar.</td></tr> <tr><td><code>collapseActionView</code></td><td>The action view associated with this action item (as declared by <code>android:actionViewLayout</code>) is collapsible.<br/>Introduced in API Level 14.</td></tr> </table> </table> <p>See the <a href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> developer <p>See the <a href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> developer guide for more information.</p> guide for more information.</p> Loading @@ -143,9 +147,10 @@ guide for more information.</p> guide for more information.</p> guide for more information.</p> <p>Introduced in API Level 11.</p></dd> <p>Introduced in API Level 11.</p></dd> <dt><code>android:actionViewClassName</code></dt> <dt><code>android:actionViewClass</code></dt> <dd><em>Class name</em>. A fully-qualified class name for the {@link android.view.View} <dd><em>Class name</em>. A fully-qualified class name for the {@link android.view.View} to use as the action view. to use as the action view. For example, {@code "android.widget.SearchView"} to use {@link android.widget.SearchView} as an action view. <p>See the <a href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> developer <p>See the <a href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> developer guide for more information.</p> guide for more information.</p> <p class="warning"><strong>Warning:</strong> If you obfuscate your code using <a <p class="warning"><strong>Warning:</strong> If you obfuscate your code using <a Loading @@ -154,6 +159,17 @@ be sure to exclude the class you specify in this attribute from renaming, becaus functionality.</p> functionality.</p> <p>Introduced in API Level 11.</p></dd> <p>Introduced in API Level 11.</p></dd> <dt><code>android:actionProviderClass</code></dt> <dd><em>Class name</em>. A fully-qualified class name for the {@link android.view.ActionProvider} to use in place of the action item. For example, {@code "android.widget.ShareActionProvider"} to use {@link android.widget.ShareActionProvider}. <p>See the <a href="{@docRoot}guide/topics/ui/actionbar.html">Action Bar</a> developer guide for more information.</p> <p class="warning"><strong>Warning:</strong> If you obfuscate your code using <a href="{@docRoot}guide/developing/tools/proguard.html">ProGuard</a> (or a similar tool), be sure to exclude the class you specify in this attribute from renaming, because it can break the functionality.</p> <p>Introduced in API Level 14.</p></dd> <dt><code>android:alphabeticShortcut</code></dt> <dt><code>android:alphabeticShortcut</code></dt> <dd><em>Char</em>. A character for the alphabetic shortcut key.</dd> <dd><em>Char</em>. A character for the alphabetic shortcut key.</dd> Loading