From feef62bc32ef6dfacd1cd1993156fe070cbe33b6 Mon Sep 17 00:00:00 2001 From: Scott Main Date: Wed, 5 Oct 2011 22:56:35 -0700 Subject: [PATCH] docs: add new action item and state list drawable resource attributes Change-Id: I68d514390b5369536be5251e23dbb298c5a0e7b0 --- .../topics/resources/drawable-resource.jd | 8 +++++++ .../guide/topics/resources/menu-resource.jd | 22 ++++++++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/docs/html/guide/topics/resources/drawable-resource.jd b/docs/html/guide/topics/resources/drawable-resource.jd index 912b6fd843232..ed9f99056bf5a 100644 --- a/docs/html/guide/topics/resources/drawable-resource.jd +++ b/docs/html/guide/topics/resources/drawable-resource.jd @@ -641,6 +641,7 @@ In XML: @[package:]drawable/filename android:drawable="@[package:]drawable/drawable_resource" android:state_pressed=["true" | "false"] android:state_focused=["true" | "false"] + android:state_hovered=["true" | "false"] android:state_selected=["true" | "false"] android:state_checkable=["true" | "false"] android:state_checked=["true" | "false"] @@ -692,6 +693,11 @@ is touched/clicked); "false" if this item should be used in the default, non-pre
Boolean. "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, non-focused state.
+
android:state_hovered
+
Boolean. "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. +

Introduced in API level 14.

android:state_selected
Boolean. "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.
@@ -729,6 +735,8 @@ default value should always be last (as demonstrated in the following example).< android:drawable="@drawable/button_pressed" /> <!-- pressed --> <item android:state_focused="true" android:drawable="@drawable/button_focused" /> <!-- focused --> + <item android:state_hovered="true" + android:drawable="@drawable/button_focused" /> <!-- hovered --> <item android:drawable="@drawable/button_normal" /> <!-- default --> </selector> diff --git a/docs/html/guide/topics/resources/menu-resource.jd b/docs/html/guide/topics/resources/menu-resource.jd index 64cdf21e4c567..fb7612e41767b 100644 --- a/docs/html/guide/topics/resources/menu-resource.jd +++ b/docs/html/guide/topics/resources/menu-resource.jd @@ -43,9 +43,10 @@ In XML: @[package:]menu.filename android:titleCondensed="string" android:icon="@[package:]drawable/drawable_resource_name" android:onClick="method name" - android:showAsAction=["ifRoom" | "never" | "withText" | "always"] + android:showAsAction=["ifRoom" | "never" | "withText" | "always" | "collapseActionView"] android:actionLayout="@[package:]layout/layout_resource_name" android:actionViewClass="class name" + android:actionProviderClass="class name" android:alphabeticShortcut="string" android:numericShortcut="string" android:checkable=["true" | "false"] @@ -131,6 +132,9 @@ of the others as a flag set, by separating them with a pipe {@code |}. 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 with other UI in the action bar. + collapseActionViewThe action view associated +with this action item (as declared by android:actionViewLayout) is +collapsible.
Introduced in API Level 14.

See the Action Bar developer guide for more information.

@@ -143,9 +147,10 @@ guide for more information.

guide for more information.

Introduced in API Level 11.

-
android:actionViewClassName
+
android:actionViewClass
Class name. 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.

See the Action Bar developer guide for more information.

Warning: If you obfuscate your code using

Introduced in API Level 11.

+
android:actionProviderClass
+
Class name. 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}. +

See the Action Bar developer +guide for more information.

+

Warning: If you obfuscate your code using ProGuard (or a similar tool), +be sure to exclude the class you specify in this attribute from renaming, because it can break the +functionality.

+

Introduced in API Level 14.

android:alphabeticShortcut
Char. A character for the alphabetic shortcut key.