diff options
65 files changed, 354 insertions, 89 deletions
diff --git a/core/java/android/content/AsyncQueryHandler.java b/core/java/android/content/AsyncQueryHandler.java index 882879b..07da99d 100644 --- a/core/java/android/content/AsyncQueryHandler.java +++ b/core/java/android/content/AsyncQueryHandler.java @@ -85,7 +85,7 @@ public abstract class AsyncQueryHandler extends Handler { cursor.getCount(); } } catch (Exception e) { - Log.w(TAG, e.toString()); + Log.w(TAG, "Exception thrown during handling EVENT_ARG_QUERY", e); cursor = null; } diff --git a/core/java/android/webkit/WebViewCore.java b/core/java/android/webkit/WebViewCore.java index 9975862..17f0a97 100644 --- a/core/java/android/webkit/WebViewCore.java +++ b/core/java/android/webkit/WebViewCore.java @@ -285,7 +285,9 @@ final class WebViewCore { int fileType = MediaFile.getFileTypeForMimeType(mimeType); return MediaFile.isAudioFileType(fileType) || MediaFile.isVideoFileType(fileType) - || MediaFile.isPlayListFileType(fileType); + || MediaFile.isPlayListFileType(fileType) + // The following is not in Media framework, but it's supported. + || (mimeType != null && mimeType.startsWith("video/m4v")); } /** diff --git a/core/java/com/android/internal/widget/ActionBarView.java b/core/java/com/android/internal/widget/ActionBarView.java index b382cee..f931217 100644 --- a/core/java/com/android/internal/widget/ActionBarView.java +++ b/core/java/com/android/internal/widget/ActionBarView.java @@ -173,7 +173,8 @@ public class ActionBarView extends ViewGroup { final LayoutInflater inflater = LayoutInflater.from(context); final int homeResId = a.getResourceId( - com.android.internal.R.styleable.ActionBar_homeLayout, 0); + com.android.internal.R.styleable.ActionBar_homeLayout, + com.android.internal.R.layout.action_bar_home); mHomeLayout = inflater.inflate(homeResId, this, false); @@ -210,13 +211,13 @@ public class ActionBarView extends ViewGroup { mLogoNavItem = new ActionMenuItem(context, 0, android.R.id.home, 0, 0, mTitle); mHomeLayout.setOnClickListener(new OnClickListener() { - public void onClick(View v) { - Context context = getContext(); - if (context instanceof Activity) { - Activity activity = (Activity) context; - activity.onMenuItemSelected(Window.FEATURE_OPTIONS_PANEL, mLogoNavItem); + public void onClick(View v) { + Context context = getContext(); + if (context instanceof Activity) { + Activity activity = (Activity) context; + activity.onMenuItemSelected(Window.FEATURE_OPTIONS_PANEL, mLogoNavItem); + } } - } }); mHomeLayout.setClickable(true); mHomeLayout.setFocusable(true); diff --git a/core/res/res/drawable-hdpi/timepicker_down_disabled_focused_holo_dark.png b/core/res/res/drawable-hdpi/timepicker_down_disabled_focused_holo_dark.png Binary files differnew file mode 100644 index 0000000..6fbd7d2 --- /dev/null +++ b/core/res/res/drawable-hdpi/timepicker_down_disabled_focused_holo_dark.png diff --git a/core/res/res/drawable-hdpi/timepicker_down_disabled_focused_holo_light.png b/core/res/res/drawable-hdpi/timepicker_down_disabled_focused_holo_light.png Binary files differnew file mode 100644 index 0000000..3a4cdec --- /dev/null +++ b/core/res/res/drawable-hdpi/timepicker_down_disabled_focused_holo_light.png diff --git a/core/res/res/drawable-hdpi/timepicker_down_disabled_holo_dark.png b/core/res/res/drawable-hdpi/timepicker_down_disabled_holo_dark.png Binary files differnew file mode 100644 index 0000000..b1c3991 --- /dev/null +++ b/core/res/res/drawable-hdpi/timepicker_down_disabled_holo_dark.png diff --git a/core/res/res/drawable-hdpi/timepicker_down_disabled_holo_light.png b/core/res/res/drawable-hdpi/timepicker_down_disabled_holo_light.png Binary files differnew file mode 100644 index 0000000..6fbce8c --- /dev/null +++ b/core/res/res/drawable-hdpi/timepicker_down_disabled_holo_light.png diff --git a/core/res/res/drawable-hdpi/timepicker_down_focused_holo_dark.png b/core/res/res/drawable-hdpi/timepicker_down_focused_holo_dark.png Binary files differnew file mode 100644 index 0000000..3bb4c29 --- /dev/null +++ b/core/res/res/drawable-hdpi/timepicker_down_focused_holo_dark.png diff --git a/core/res/res/drawable-hdpi/timepicker_down_focused_holo_light.png b/core/res/res/drawable-hdpi/timepicker_down_focused_holo_light.png Binary files differnew file mode 100644 index 0000000..8f02162 --- /dev/null +++ b/core/res/res/drawable-hdpi/timepicker_down_focused_holo_light.png diff --git a/core/res/res/drawable-hdpi/timepicker_down_longpressed_holo_dark.png b/core/res/res/drawable-hdpi/timepicker_down_longpressed_holo_dark.png Binary files differnew file mode 100644 index 0000000..8f57d2c --- /dev/null +++ b/core/res/res/drawable-hdpi/timepicker_down_longpressed_holo_dark.png diff --git a/core/res/res/drawable-hdpi/timepicker_down_longpressed_holo_light.png b/core/res/res/drawable-hdpi/timepicker_down_longpressed_holo_light.png Binary files differnew file mode 100644 index 0000000..df6f76b --- /dev/null +++ b/core/res/res/drawable-hdpi/timepicker_down_longpressed_holo_light.png diff --git a/core/res/res/drawable-hdpi/timepicker_down_normal_holo_dark.png b/core/res/res/drawable-hdpi/timepicker_down_normal_holo_dark.png Binary files differnew file mode 100644 index 0000000..a47bf31 --- /dev/null +++ b/core/res/res/drawable-hdpi/timepicker_down_normal_holo_dark.png diff --git a/core/res/res/drawable-hdpi/timepicker_down_normal_holo_light.png b/core/res/res/drawable-hdpi/timepicker_down_normal_holo_light.png Binary files differnew file mode 100644 index 0000000..04046aa --- /dev/null +++ b/core/res/res/drawable-hdpi/timepicker_down_normal_holo_light.png diff --git a/core/res/res/drawable-hdpi/timepicker_down_pressed_holo_dark.png b/core/res/res/drawable-hdpi/timepicker_down_pressed_holo_dark.png Binary files differnew file mode 100644 index 0000000..b6021e0 --- /dev/null +++ b/core/res/res/drawable-hdpi/timepicker_down_pressed_holo_dark.png diff --git a/core/res/res/drawable-hdpi/timepicker_down_pressed_holo_light.png b/core/res/res/drawable-hdpi/timepicker_down_pressed_holo_light.png Binary files differnew file mode 100644 index 0000000..0f38d6b --- /dev/null +++ b/core/res/res/drawable-hdpi/timepicker_down_pressed_holo_light.png diff --git a/core/res/res/drawable-hdpi/timepicker_up_disabled_focused_holo_dark.png b/core/res/res/drawable-hdpi/timepicker_up_disabled_focused_holo_dark.png Binary files differnew file mode 100644 index 0000000..14a4e31 --- /dev/null +++ b/core/res/res/drawable-hdpi/timepicker_up_disabled_focused_holo_dark.png diff --git a/core/res/res/drawable-hdpi/timepicker_up_disabled_focused_holo_light.png b/core/res/res/drawable-hdpi/timepicker_up_disabled_focused_holo_light.png Binary files differnew file mode 100644 index 0000000..21a2ac1 --- /dev/null +++ b/core/res/res/drawable-hdpi/timepicker_up_disabled_focused_holo_light.png diff --git a/core/res/res/drawable-hdpi/timepicker_up_disabled_holo_dark.png b/core/res/res/drawable-hdpi/timepicker_up_disabled_holo_dark.png Binary files differnew file mode 100644 index 0000000..1a1da57 --- /dev/null +++ b/core/res/res/drawable-hdpi/timepicker_up_disabled_holo_dark.png diff --git a/core/res/res/drawable-hdpi/timepicker_up_disabled_holo_light.png b/core/res/res/drawable-hdpi/timepicker_up_disabled_holo_light.png Binary files differnew file mode 100644 index 0000000..a242c80 --- /dev/null +++ b/core/res/res/drawable-hdpi/timepicker_up_disabled_holo_light.png diff --git a/core/res/res/drawable-hdpi/timepicker_up_focused_holo_dark.png b/core/res/res/drawable-hdpi/timepicker_up_focused_holo_dark.png Binary files differnew file mode 100644 index 0000000..50045e4 --- /dev/null +++ b/core/res/res/drawable-hdpi/timepicker_up_focused_holo_dark.png diff --git a/core/res/res/drawable-hdpi/timepicker_up_focused_holo_light.png b/core/res/res/drawable-hdpi/timepicker_up_focused_holo_light.png Binary files differnew file mode 100644 index 0000000..659b3c7 --- /dev/null +++ b/core/res/res/drawable-hdpi/timepicker_up_focused_holo_light.png diff --git a/core/res/res/drawable-hdpi/timepicker_up_longpressed_holo_dark.png b/core/res/res/drawable-hdpi/timepicker_up_longpressed_holo_dark.png Binary files differnew file mode 100644 index 0000000..9112530 --- /dev/null +++ b/core/res/res/drawable-hdpi/timepicker_up_longpressed_holo_dark.png diff --git a/core/res/res/drawable-hdpi/timepicker_up_longpressed_holo_light.png b/core/res/res/drawable-hdpi/timepicker_up_longpressed_holo_light.png Binary files differnew file mode 100644 index 0000000..21aa7f7 --- /dev/null +++ b/core/res/res/drawable-hdpi/timepicker_up_longpressed_holo_light.png diff --git a/core/res/res/drawable-hdpi/timepicker_up_normal_holo_dark.png b/core/res/res/drawable-hdpi/timepicker_up_normal_holo_dark.png Binary files differnew file mode 100644 index 0000000..d145975 --- /dev/null +++ b/core/res/res/drawable-hdpi/timepicker_up_normal_holo_dark.png diff --git a/core/res/res/drawable-hdpi/timepicker_up_normal_holo_light.png b/core/res/res/drawable-hdpi/timepicker_up_normal_holo_light.png Binary files differnew file mode 100644 index 0000000..167bab7 --- /dev/null +++ b/core/res/res/drawable-hdpi/timepicker_up_normal_holo_light.png diff --git a/core/res/res/drawable-hdpi/timepicker_up_pressed_holo_dark.png b/core/res/res/drawable-hdpi/timepicker_up_pressed_holo_dark.png Binary files differnew file mode 100644 index 0000000..2844c3f --- /dev/null +++ b/core/res/res/drawable-hdpi/timepicker_up_pressed_holo_dark.png diff --git a/core/res/res/drawable-hdpi/timepicker_up_pressed_holo_light.png b/core/res/res/drawable-hdpi/timepicker_up_pressed_holo_light.png Binary files differnew file mode 100644 index 0000000..9d83038 --- /dev/null +++ b/core/res/res/drawable-hdpi/timepicker_up_pressed_holo_light.png diff --git a/core/res/res/drawable-mdpi/timepicker_down_disabled_focused_holo_dark.png b/core/res/res/drawable-mdpi/timepicker_down_disabled_focused_holo_dark.png Binary files differnew file mode 100644 index 0000000..d86534c --- /dev/null +++ b/core/res/res/drawable-mdpi/timepicker_down_disabled_focused_holo_dark.png diff --git a/core/res/res/drawable-mdpi/timepicker_down_disabled_focused_holo_light.png b/core/res/res/drawable-mdpi/timepicker_down_disabled_focused_holo_light.png Binary files differnew file mode 100644 index 0000000..6ae5d4b --- /dev/null +++ b/core/res/res/drawable-mdpi/timepicker_down_disabled_focused_holo_light.png diff --git a/core/res/res/drawable-mdpi/timepicker_down_disabled_holo_dark.png b/core/res/res/drawable-mdpi/timepicker_down_disabled_holo_dark.png Binary files differnew file mode 100644 index 0000000..fd578b6 --- /dev/null +++ b/core/res/res/drawable-mdpi/timepicker_down_disabled_holo_dark.png diff --git a/core/res/res/drawable-mdpi/timepicker_down_disabled_holo_light.png b/core/res/res/drawable-mdpi/timepicker_down_disabled_holo_light.png Binary files differnew file mode 100644 index 0000000..a0caaa9 --- /dev/null +++ b/core/res/res/drawable-mdpi/timepicker_down_disabled_holo_light.png diff --git a/core/res/res/drawable-mdpi/timepicker_down_focused_holo_dark.png b/core/res/res/drawable-mdpi/timepicker_down_focused_holo_dark.png Binary files differnew file mode 100644 index 0000000..f6f4ed2 --- /dev/null +++ b/core/res/res/drawable-mdpi/timepicker_down_focused_holo_dark.png diff --git a/core/res/res/drawable-mdpi/timepicker_down_focused_holo_light.png b/core/res/res/drawable-mdpi/timepicker_down_focused_holo_light.png Binary files differnew file mode 100644 index 0000000..2591adb --- /dev/null +++ b/core/res/res/drawable-mdpi/timepicker_down_focused_holo_light.png diff --git a/core/res/res/drawable-mdpi/timepicker_down_longpressed_holo_dark.png b/core/res/res/drawable-mdpi/timepicker_down_longpressed_holo_dark.png Binary files differnew file mode 100644 index 0000000..efee099 --- /dev/null +++ b/core/res/res/drawable-mdpi/timepicker_down_longpressed_holo_dark.png diff --git a/core/res/res/drawable-mdpi/timepicker_down_longpressed_holo_light.png b/core/res/res/drawable-mdpi/timepicker_down_longpressed_holo_light.png Binary files differnew file mode 100644 index 0000000..f7b09de --- /dev/null +++ b/core/res/res/drawable-mdpi/timepicker_down_longpressed_holo_light.png diff --git a/core/res/res/drawable-mdpi/timepicker_down_normal_holo_dark.png b/core/res/res/drawable-mdpi/timepicker_down_normal_holo_dark.png Binary files differnew file mode 100644 index 0000000..76f13a6 --- /dev/null +++ b/core/res/res/drawable-mdpi/timepicker_down_normal_holo_dark.png diff --git a/core/res/res/drawable-mdpi/timepicker_down_normal_holo_light.png b/core/res/res/drawable-mdpi/timepicker_down_normal_holo_light.png Binary files differnew file mode 100644 index 0000000..cb8e764 --- /dev/null +++ b/core/res/res/drawable-mdpi/timepicker_down_normal_holo_light.png diff --git a/core/res/res/drawable-mdpi/timepicker_down_pressed_holo_dark.png b/core/res/res/drawable-mdpi/timepicker_down_pressed_holo_dark.png Binary files differnew file mode 100644 index 0000000..7c0d0bc --- /dev/null +++ b/core/res/res/drawable-mdpi/timepicker_down_pressed_holo_dark.png diff --git a/core/res/res/drawable-mdpi/timepicker_down_pressed_holo_light.png b/core/res/res/drawable-mdpi/timepicker_down_pressed_holo_light.png Binary files differnew file mode 100644 index 0000000..9d7ff6b --- /dev/null +++ b/core/res/res/drawable-mdpi/timepicker_down_pressed_holo_light.png diff --git a/core/res/res/drawable-mdpi/timepicker_up_disabled_focused_holo_dark.png b/core/res/res/drawable-mdpi/timepicker_up_disabled_focused_holo_dark.png Binary files differnew file mode 100644 index 0000000..cfdfd174 --- /dev/null +++ b/core/res/res/drawable-mdpi/timepicker_up_disabled_focused_holo_dark.png diff --git a/core/res/res/drawable-mdpi/timepicker_up_disabled_focused_holo_light.png b/core/res/res/drawable-mdpi/timepicker_up_disabled_focused_holo_light.png Binary files differnew file mode 100644 index 0000000..43bdf1d --- /dev/null +++ b/core/res/res/drawable-mdpi/timepicker_up_disabled_focused_holo_light.png diff --git a/core/res/res/drawable-mdpi/timepicker_up_disabled_holo_dark.png b/core/res/res/drawable-mdpi/timepicker_up_disabled_holo_dark.png Binary files differnew file mode 100644 index 0000000..2ffe46b --- /dev/null +++ b/core/res/res/drawable-mdpi/timepicker_up_disabled_holo_dark.png diff --git a/core/res/res/drawable-mdpi/timepicker_up_disabled_holo_light.png b/core/res/res/drawable-mdpi/timepicker_up_disabled_holo_light.png Binary files differnew file mode 100644 index 0000000..51bb2d0 --- /dev/null +++ b/core/res/res/drawable-mdpi/timepicker_up_disabled_holo_light.png diff --git a/core/res/res/drawable-mdpi/timepicker_up_focused_holo_dark.png b/core/res/res/drawable-mdpi/timepicker_up_focused_holo_dark.png Binary files differnew file mode 100644 index 0000000..dece157 --- /dev/null +++ b/core/res/res/drawable-mdpi/timepicker_up_focused_holo_dark.png diff --git a/core/res/res/drawable-mdpi/timepicker_up_focused_holo_light.png b/core/res/res/drawable-mdpi/timepicker_up_focused_holo_light.png Binary files differnew file mode 100644 index 0000000..384cb32 --- /dev/null +++ b/core/res/res/drawable-mdpi/timepicker_up_focused_holo_light.png diff --git a/core/res/res/drawable-mdpi/timepicker_up_longpressed_holo_dark.png b/core/res/res/drawable-mdpi/timepicker_up_longpressed_holo_dark.png Binary files differnew file mode 100644 index 0000000..84ec4f7 --- /dev/null +++ b/core/res/res/drawable-mdpi/timepicker_up_longpressed_holo_dark.png diff --git a/core/res/res/drawable-mdpi/timepicker_up_longpressed_holo_light.png b/core/res/res/drawable-mdpi/timepicker_up_longpressed_holo_light.png Binary files differnew file mode 100644 index 0000000..318befc --- /dev/null +++ b/core/res/res/drawable-mdpi/timepicker_up_longpressed_holo_light.png diff --git a/core/res/res/drawable-mdpi/timepicker_up_normal_holo_dark.png b/core/res/res/drawable-mdpi/timepicker_up_normal_holo_dark.png Binary files differnew file mode 100644 index 0000000..d97a832 --- /dev/null +++ b/core/res/res/drawable-mdpi/timepicker_up_normal_holo_dark.png diff --git a/core/res/res/drawable-mdpi/timepicker_up_normal_holo_light.png b/core/res/res/drawable-mdpi/timepicker_up_normal_holo_light.png Binary files differnew file mode 100644 index 0000000..19d75e5 --- /dev/null +++ b/core/res/res/drawable-mdpi/timepicker_up_normal_holo_light.png diff --git a/core/res/res/drawable-mdpi/timepicker_up_pressed_holo_dark.png b/core/res/res/drawable-mdpi/timepicker_up_pressed_holo_dark.png Binary files differnew file mode 100644 index 0000000..1189e5c --- /dev/null +++ b/core/res/res/drawable-mdpi/timepicker_up_pressed_holo_dark.png diff --git a/core/res/res/drawable-mdpi/timepicker_up_pressed_holo_light.png b/core/res/res/drawable-mdpi/timepicker_up_pressed_holo_light.png Binary files differnew file mode 100644 index 0000000..9f283ab --- /dev/null +++ b/core/res/res/drawable-mdpi/timepicker_up_pressed_holo_light.png diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml index 457ba0c..403ec2f 100644 --- a/core/res/res/values/styles.xml +++ b/core/res/res/values/styles.xml @@ -917,7 +917,7 @@ <item name="android:subtitleTextStyle">@android:style/TextAppearance.Widget.ActionBar.Subtitle</item> <item name="android:progressBarStyle">@android:style/Widget.ProgressBar.Horizontal</item> <item name="android:indeterminateProgressStyle">@android:style/Widget.ProgressBar.Small</item> - <item name="android:homeLayout">@layout/action_bar_home</item> + <item name="android:homeLayout">@android:layout/action_bar_home</item> </style> <style name="Widget.ActionMode"> diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml index b5dcf05..f5dca47 100644 --- a/core/res/res/values/themes.xml +++ b/core/res/res/values/themes.xml @@ -92,6 +92,7 @@ <item name="groupButtonBackground">@null</item> <item name="selectableItemBackground">@android:drawable/item_background</item> + <item name="homeAsUpIndicator">@android:drawable/ic_ab_back_holo_dark</item> <!-- List attributes --> <item name="listPreferredItemHeight">64dip</item> diff --git a/docs/html/guide/topics/resources/menu-resource.jd b/docs/html/guide/topics/resources/menu-resource.jd index cde72bd..7bcd78a 100644 --- a/docs/html/guide/topics/resources/menu-resource.jd +++ b/docs/html/guide/topics/resources/menu-resource.jd @@ -36,22 +36,23 @@ In XML: <code>@[<em>package</em>:]menu.<em>filename</em></code> <?xml version="1.0" encoding="utf-8"?> <<a href="#menu-element">menu</a> xmlns:android="http://schemas.android.com/apk/res/android"> <<a href="#item-element">item</a> android:id="@[+][<em>package</em>:]id/<em>resource_name</em>" - android:menuCategory=["container" | "system" | "secondary" | "alternative"] - android:orderInCategory="<em>integer</em>" android:title="<em>string</em>" android:titleCondensed="<em>string</em>" android:icon="@[package:]drawable/<em>drawable_resource_name</em>" + android:showAsAction=["ifRoom" | "never" | "withText" | "always"] android:alphabeticShortcut="<em>string</em>" android:numericShortcut="<em>string</em>" android:checkable=["true" | "false"] android:visible=["visible" | "invisible" | "gone"] - android:enabled=["enabled" | "disabled"] /> + android:enabled=["enabled" | "disabled"] + android:menuCategory=["container" | "system" | "secondary" | "alternative"] + android:orderInCategory="<em>integer</em>" /> <<a href="#group-element">group</a> android:id="@[+][<em>package</em>:]id/<em>resource name</em>" - android:menuCategory=["container" | "system" | "secondary" | "alternative"] - android:orderInCategory="<em>integer</em>" android:checkableBehavior=["none" | "all" | "single"] android:visible=["visible" | "invisible" | "gone"] - android:enabled=["enabled" | "disabled"] > + android:enabled=["enabled" | "disabled"] + android:menuCategory=["container" | "system" | "secondary" | "alternative"] + android:orderInCategory="<em>integer</em>" > <<a href="#item-element">item</a> /> </group> <<a href="#item-element">item</a> > @@ -77,91 +78,120 @@ In XML: <code>@[<em>package</em>:]menu.<em>filename</em></code> <code>"http://schemas.android.com/apk/res/android"</code>. </dl> </dd> - <dt id="group-element"><code><group></code></dt> - <dd>A menu group (to create a collection of items that share traits, such as whether they are -visible, enabled, or checkable). Contains one or more <code><item></code> elements. Must be a -child of a <code><menu></code> element. + + <dt id="item-element"><code><item></code></dt> + <dd>A menu item. May contain a <code><menu></code> element (for a Sub + Menu). Must be a child of a <code><menu></code> or <code><group></code> element. <p class="caps">attributes:</p> <dl class="atn-list"> <dt><code>android:id</code></dt> <dd><em>Resource ID</em>. A unique resource ID. To create a new resource ID for this item, use the form: -<code>"@+id/<em>name</em>"</code>. The plus symbol indicates that this should be created as a new ID.</dd> +<code>"@+id/<em>name</em>"</code>. The plus symbol indicates that this should be created as a new +ID.</dd> + <dt><code>android:title</code></dt> + <dd><em>String</em>. The menu title.</dd> + <dt><code>android:titleCondensed</code></dt> + <dd><em>String</em>. A condensed title, for situations in which the normal title is +too long.</dd> + <dt><code>android:icon</code></dt> + <dd><em>Drawable resource</em>. An image to be used as the menu item icon.</dd> + + <dt><code>android:showAsAction</code></dt> + <dd><em>Keyword</em>. When and how this item should appear as an action item in the Action +Bar. A menu item can appear as an action item only when the activity includes an {@link +android.app.ActionBar} (introduced in API Level HONEYCOMB). Valid values: + <table> + <tr><th>Value</th><th>Description</th></tr> + <tr><td><code>ifRoom</code></td><td>Only place this item in the Action Bar if +there is room for it.</td></tr> + <tr><td><code>withText</code></td><td>Also include the title text (defined +by {@code android:title}) with the action item. You can include this value along with one +of the others as a flag set, by separating them with a pipe {@code |}.</td></tr> + <tr><td><code>never</code></td><td>Never place this item in the Action Bar.</td></tr> + <tr><td><code>always</code></td><td>Always place this item in the Action Bar. +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.</td></tr> + </table> + <p>See <a href="{@docRoot}guide/topics/ui/actionbar.html">Using the Action Bar</a> for +more information.</p> + <p>Introduced in API Level HONEYCOMB.</p> + </dd> + + <dt><code>android:alphabeticShortcut</code></dt> + <dd><em>Char</em>. A character for the alphabetic shortcut key.</dd> + <dt><code>android:numericShortcut</code></dt> + <dd><em>Integer</em>. A number for the numeric shortcut key.</dd> + <dt><code>android:checkable</code></dt> + <dd><em>Boolean</em>. "true" if the item is checkable.</dd> + <dt><code>android:checked</code></dt> + <dd><em>Boolean</em>. "true" if the item is checked by default.</dd> + <dt><code>android:visible</code></dt> + <dd><em>Boolean</em>. "true" if the item is visible by default.</dd> + <dt><code>android:enabled</code></dt> + <dd><em>Boolean</em>. "true" if the item is enabled by default.</dd> <dt><code>android:menuCategory</code></dt> <dd><em>Keyword</em>. Value corresponding to {@link android.view.Menu} {@code CATEGORY_*} - constants, which define the group's priority. Valid values: + constants, which define the item's priority. Valid values: <table> <tr><th>Value</th><th>Description</th></tr> - <tr><td><code>container</code></td><td>For groups that are part of a + <tr><td><code>container</code></td><td>For items that are part of a container.</td></tr> - <tr><td><code>system</code></td><td>For groups that are provided by the + <tr><td><code>system</code></td><td>For items that are provided by the system.</td></tr> - <tr><td><code>secondary</code></td><td>For groups that are user-supplied secondary + <tr><td><code>secondary</code></td><td>For items that are user-supplied secondary (infrequently used) options.</td></tr> - <tr><td><code>alternative</code></td><td>For groups that are alternative actions + <tr><td><code>alternative</code></td><td>For items that are alternative actions on the data that is currently displayed.</td></tr> </table> </dd> <dt><code>android:orderInCategory</code></dt> - <dd><em>Integer</em>. The default order of the items within the category.</dd> + <dd><em>Integer</em>. The order of "importance" of the item, within a group.</dd> + </dl> + </dd> + + <dt id="group-element"><code><group></code></dt> + <dd>A menu group (to create a collection of items that share traits, such as whether they are +visible, enabled, or checkable). Contains one or more <code><item></code> elements. Must be a +child of a <code><menu></code> element. + <p class="caps">attributes:</p> + <dl class="atn-list"> + <dt><code>android:id</code></dt> + <dd><em>Resource ID</em>. A unique resource ID. To create a new resource ID for this item, +use the form: +<code>"@+id/<em>name</em>"</code>. The plus symbol indicates that this should be created as a new +ID.</dd> <dt><code>android:checkableBehavior</code></dt> <dd><em>Keyword</em>. The type of checkable behavior for the group. Valid values: <table> <tr><th>Value</th><th>Description</th></tr> <tr><td><code>none</code></td><td>Not checkable</td></tr> <tr><td><code>all</code></td><td>All items can be checked (use checkboxes)</td></tr> - <tr><td><code>single</code></td><td>Only one item can be checked (use radio buttons)</td></tr> + <tr><td><code>single</code></td><td>Only one item can be checked (use radio +buttons)</td></tr> </table> </dd> <dt><code>android:visible</code></dt> <dd><em>Boolean</em>. "true" if the group is visible.</dd> <dt><code>android:enabled</code></dt> <dd><em>Boolean</em>. "true" if the group is enabled.</dd> - </dl> - </dd> - <dt id="item-element"><code><item></code></dt> - <dd>A menu item. May contain a <code><menu></code> element (for a Sub - Menu). Must be a child of a <code><menu></code> or <code><group></code> element. - <p class="caps">attributes:</p> - <dl class="atn-list"> - <dt><code>android:id</code></dt> - <dd><em>Resource ID</em>. A unique resource ID. To create a new resource ID for this item, use the form: -<code>"@+id/<em>name</em>"</code>. The plus symbol indicates that this should be created as a new ID.</dd> <dt><code>android:menuCategory</code></dt> <dd><em>Keyword</em>. Value corresponding to {@link android.view.Menu} {@code CATEGORY_*} - constants, which define the item's priority. Valid values: + constants, which define the group's priority. Valid values: <table> <tr><th>Value</th><th>Description</th></tr> - <tr><td><code>container</code></td><td>For items that are part of a + <tr><td><code>container</code></td><td>For groups that are part of a container.</td></tr> - <tr><td><code>system</code></td><td>For items that are provided by the + <tr><td><code>system</code></td><td>For groups that are provided by the system.</td></tr> - <tr><td><code>secondary</code></td><td>For items that are user-supplied secondary + <tr><td><code>secondary</code></td><td>For groups that are user-supplied secondary (infrequently used) options.</td></tr> - <tr><td><code>alternative</code></td><td>For items that are alternative actions + <tr><td><code>alternative</code></td><td>For groups that are alternative actions on the data that is currently displayed.</td></tr> </table> </dd> <dt><code>android:orderInCategory</code></dt> - <dd><em>Integer</em>. The order of "importance" of the item, within a group.</dd> - <dt><code>android:title</code></dt> - <dd><em>String</em>. The menu title.</dd> - <dt><code>android:titleCondensed</code></dt> - <dd><em>String</em>. A condensed title, for situations in which the normal title is -too long.</dd> - <dt><code>android:icon</code></dt> - <dd><em>Drawable resource</em>. An image to be used as the menu item icon.</dd> - <dt><code>android:alphabeticShortcut</code></dt> - <dd><em>Char</em>. A character for the alphabetic shortcut key.</dd> - <dt><code>android:numericShortcut</code></dt> - <dd><em>Integer</em>. A number for the numeric shortcut key.</dd> - <dt><code>android:checkable</code></dt> - <dd><em>Boolean</em>. "true" if the item is checkable.</dd> - <dt><code>android:checked</code></dt> - <dd><em>Boolean</em>. "true" if the item is checked by default.</dd> - <dt><code>android:visible</code></dt> - <dd><em>Boolean</em>. "true" if the item is visible by default.</dd> - <dt><code>android:enabled</code></dt> - <dd><em>Boolean</em>. "true" if the item is enabled by default.</dd> + <dd><em>Integer</em>. The default order of the items within the category.</dd> </dl> </dd> </dl> @@ -174,7 +204,8 @@ too long.</dd> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/item1" android:title="@string/item1" - android:icon="@drawable/group_item1_icon" /> + android:icon="@drawable/group_item1_icon" + android:showAsAction="ifRoom|withText"/> <group android:id="@+id/group"> <item android:id="@+id/group_item1" android:title="@string/group_item1" @@ -184,7 +215,8 @@ too long.</dd> android:icon="@drawable/group_item2_icon" /> </group> <item android:id="@+id/submenu" - android:title="@string/submenu_title" > + android:title="@string/submenu_title" + android:showAsAction="ifRoom|withText" > <menu> <item android:id="@+id/submenu_item1" android:title="@string/submenu_item1" /> @@ -201,6 +233,8 @@ public boolean onCreateOptionsMenu(Menu menu) { return true; } </pre> +<p class="note"><strong>Note:</strong> The {@code android:showAsAction} attribute is +available only on Android X.X (API Level HONEYCOMB) and greater.</p> </dd> <!-- end example --> diff --git a/include/media/stagefright/DataSource.h b/include/media/stagefright/DataSource.h index d0b9fcd..27f33fb 100644 --- a/include/media/stagefright/DataSource.h +++ b/include/media/stagefright/DataSource.h @@ -80,6 +80,9 @@ public: } virtual void getDrmInfo(DecryptHandle **handle, DrmManagerClient **client) {}; + virtual String8 getUri() { + return String8(); + } protected: virtual ~DataSource() {} diff --git a/media/libstagefright/NuCachedSource2.cpp b/media/libstagefright/NuCachedSource2.cpp index 4a2402b..3bb38de 100644 --- a/media/libstagefright/NuCachedSource2.cpp +++ b/media/libstagefright/NuCachedSource2.cpp @@ -526,5 +526,8 @@ void NuCachedSource2::getDrmInfo(DecryptHandle **handle, DrmManagerClient **clie mSource->getDrmInfo(handle, client); } +String8 NuCachedSource2::getUri() { + return mSource->getUri(); +} } // namespace android diff --git a/media/libstagefright/NuHTTPDataSource.cpp b/media/libstagefright/NuHTTPDataSource.cpp index 133f225..40f501a 100644 --- a/media/libstagefright/NuHTTPDataSource.cpp +++ b/media/libstagefright/NuHTTPDataSource.cpp @@ -424,4 +424,8 @@ void NuHTTPDataSource::getDrmInfo(DecryptHandle **handle, DrmManagerClient **cli *client = mDrmManagerClient; } +String8 NuHTTPDataSource::getUri() { + return mUri; +} + } // namespace android diff --git a/media/libstagefright/include/NuCachedSource2.h b/media/libstagefright/include/NuCachedSource2.h index 8cec1b1..5e404b6 100644 --- a/media/libstagefright/include/NuCachedSource2.h +++ b/media/libstagefright/include/NuCachedSource2.h @@ -39,6 +39,7 @@ struct NuCachedSource2 : public DataSource { virtual DecryptHandle* DrmInitialization(DrmManagerClient *client); virtual void getDrmInfo(DecryptHandle **handle, DrmManagerClient **client); + virtual String8 getUri(); //////////////////////////////////////////////////////////////////////////// size_t cachedSize(); diff --git a/media/libstagefright/include/NuHTTPDataSource.h b/media/libstagefright/include/NuHTTPDataSource.h index c707fdc..0b840bd 100644 --- a/media/libstagefright/include/NuHTTPDataSource.h +++ b/media/libstagefright/include/NuHTTPDataSource.h @@ -33,6 +33,7 @@ struct NuHTTPDataSource : public DataSource { virtual DecryptHandle* DrmInitialization(DrmManagerClient *client); virtual void getDrmInfo(DecryptHandle **handle, DrmManagerClient **client); + virtual String8 getUri(); protected: virtual ~NuHTTPDataSource(); diff --git a/packages/SystemUI/assets/fonts/AndroidClock.ttf b/packages/SystemUI/assets/fonts/AndroidClock.ttf Binary files differnew file mode 100644 index 0000000..3945183 --- /dev/null +++ b/packages/SystemUI/assets/fonts/AndroidClock.ttf diff --git a/packages/SystemUI/assets/fonts/AndroidClock2.ttf b/packages/SystemUI/assets/fonts/AndroidClock2.ttf Binary files differnew file mode 100644 index 0000000..fa0221e --- /dev/null +++ b/packages/SystemUI/assets/fonts/AndroidClock2.ttf diff --git a/packages/SystemUI/res/layout-xlarge/status_bar.xml b/packages/SystemUI/res/layout-xlarge/status_bar.xml index b8b8bdd..d4a6136 100644 --- a/packages/SystemUI/res/layout-xlarge/status_bar.xml +++ b/packages/SystemUI/res/layout-xlarge/status_bar.xml @@ -57,20 +57,25 @@ android:layout_width="wrap_content" android:layout_height="match_parent" > - <!-- paddingLeft: 24 dips = 32dp (total space to icon) - 8dp in the icon. - TODO: Make sure the font has a small enough leading that we don't need this - negative margin business. --> - <com.android.systemui.statusbar.policy.Clock - style="@*android:style/TextAppearance.StatusBar.Icon" + <com.android.systemui.statusbar.tablet.HoloClock android:id="@+id/clock" android:layout_width="wrap_content" - android:layout_height="65dp" - android:layout_marginTop="-17dp" - android:singleLine="true" - android:textSize="60sp" - android:paddingLeft="24dip" - android:textColor="#2e2e2e" - /> + android:layout_height="match_parent" + > + <TextView android:id="@+id/time_bg" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:singleLine="true" + android:textSize="72dip" + android:textColor="#1f1f1f" /> + <TextView android:id="@+id/time_fg" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:singleLine="true" + android:textSize="72dip" + android:textColor="#2e2e2e" /> + </com.android.systemui.statusbar.tablet.HoloClock> + <LinearLayout android:layout_width="48dip" android:layout_height="match_parent" diff --git a/packages/SystemUI/res/layout-xlarge/sysbar_panel_notifications.xml b/packages/SystemUI/res/layout-xlarge/sysbar_panel_notifications.xml index 186aa64..b23cc7b 100644 --- a/packages/SystemUI/res/layout-xlarge/sysbar_panel_notifications.xml +++ b/packages/SystemUI/res/layout-xlarge/sysbar_panel_notifications.xml @@ -40,15 +40,29 @@ android:layout_alignParentRight="true" > - <com.android.systemui.statusbar.policy.Clock + <com.android.systemui.statusbar.tablet.HoloClock android:id="@+id/clock" android:layout_height="wrap_content" android:layout_width="match_parent" android:layout_alignParentTop="true" - android:layout_marginRight="48dp" - android:textSize="70sp" - android:gravity="right" - /> + android:layout_marginRight="40dip" + android:layout_marginBottom="4dip" + > + <TextView android:id="@+id/time_bg" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="right" + android:singleLine="true" + android:textSize="90dip" + android:textColor="#999999" /> + <TextView android:id="@+id/time_fg" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="right" + android:singleLine="true" + android:textSize="90dip" + android:textColor="#666666" /> + </com.android.systemui.statusbar.tablet.HoloClock> <com.android.systemui.statusbar.policy.DateView android:id="@+id/date" diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/HoloClock.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/HoloClock.java new file mode 100644 index 0000000..3b76434 --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/HoloClock.java @@ -0,0 +1,169 @@ +/* + * Copyright (C) 2006 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.systemui.statusbar.tablet; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; +import android.content.res.AssetManager; +import android.content.res.Resources; +import android.content.res.TypedArray; +import android.graphics.Canvas; +import android.graphics.Typeface; +import android.graphics.drawable.Drawable; +import android.text.Spannable; +import android.text.SpannableStringBuilder; +import android.text.format.DateFormat; +import android.text.style.CharacterStyle; +import android.text.style.ForegroundColorSpan; +import android.text.style.RelativeSizeSpan; +import android.text.style.RelativeSizeSpan; +import android.text.style.StyleSpan; +import android.util.AttributeSet; +import android.view.View; +import android.view.ViewGroup; +import android.widget.FrameLayout; +import android.widget.TextView; + +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.TimeZone; + +import com.android.systemui.R; + +public class HoloClock extends FrameLayout { + private boolean mAttached; + private Calendar mCalendar; + private String mClockFormatString; + private SimpleDateFormat mClockFormat; + + private static Typeface sBackgroundType, sForegroundType; + private TextView mBgText, mFgText; + + public HoloClock(Context context) { + this(context, null); + } + + public HoloClock(Context context, AttributeSet attrs) { + this(context, attrs, 0); + } + + public HoloClock(Context context, AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + } + + @Override + protected void onFinishInflate() { + super.onFinishInflate(); + + if (sBackgroundType == null) { + AssetManager assets = getContext().getAssets(); + + sBackgroundType = Typeface.createFromAsset(assets, + "fonts/AndroidClock.ttf"); + sForegroundType = Typeface.createFromAsset(assets, + "fonts/AndroidClock2.ttf"); + } + mBgText = (TextView) findViewById(R.id.time_bg); + if (mBgText != null) { + mBgText.setTypeface(sBackgroundType); + } + mFgText = (TextView) findViewById(R.id.time_fg); + if (mFgText != null) { + mFgText.setTypeface(sForegroundType); + } + } + + @Override + protected void onAttachedToWindow() { + super.onAttachedToWindow(); + + if (!mAttached) { + mAttached = true; + IntentFilter filter = new IntentFilter(); + + filter.addAction(Intent.ACTION_TIME_TICK); + filter.addAction(Intent.ACTION_TIME_CHANGED); + filter.addAction(Intent.ACTION_TIMEZONE_CHANGED); + filter.addAction(Intent.ACTION_CONFIGURATION_CHANGED); + + getContext().registerReceiver(mIntentReceiver, filter, null, getHandler()); + } + + // NOTE: It's safe to do these after registering the receiver since the receiver always runs + // in the main thread, therefore the receiver can't run before this method returns. + + // The time zone may have changed while the receiver wasn't registered, so update the Time + mCalendar = Calendar.getInstance(TimeZone.getDefault()); + + // Make sure we update to the current time + updateClock(); + } + + @Override + protected void onDetachedFromWindow() { + super.onDetachedFromWindow(); + if (mAttached) { + getContext().unregisterReceiver(mIntentReceiver); + mAttached = false; + } + } + + private final BroadcastReceiver mIntentReceiver = new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + String action = intent.getAction(); + if (action.equals(Intent.ACTION_TIMEZONE_CHANGED)) { + String tz = intent.getStringExtra("time-zone"); + mCalendar = Calendar.getInstance(TimeZone.getTimeZone(tz)); + if (mClockFormat != null) { + mClockFormat.setTimeZone(mCalendar.getTimeZone()); + } + } + updateClock(); + } + }; + + final void updateClock() { + mCalendar.setTimeInMillis(System.currentTimeMillis()); + CharSequence txt = getTimeText(); + mBgText.setText(txt); + mFgText.setText(txt); + } + + private final CharSequence getTimeText() { + Context context = getContext(); + int res = DateFormat.is24HourFormat(context) + ? com.android.internal.R.string.twenty_four_hour_time_format + : com.android.internal.R.string.twelve_hour_time_format; + + SimpleDateFormat sdf; + String format = context.getString(res); + if (!format.equals(mClockFormatString)) { + // we don't want AM/PM showing up in our statusbar, even in 12h mode + format = format.replaceAll("a", "").trim(); + mClockFormat = sdf = new SimpleDateFormat(format); + mClockFormatString = format; + } else { + sdf = mClockFormat; + } + String result = sdf.format(mCalendar.getTime()); + return result; + } +} + diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeResources.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeResources.java index 46eb776..bfbb01a8 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeResources.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeResources.java @@ -43,6 +43,7 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileReader; +import java.io.IOException; import java.io.InputStream; /** @@ -155,14 +156,40 @@ public final class BridgeResources extends Resources { @Override public ColorStateList getColorStateList(int id) throws NotFoundException { - IResourceValue value = getResourceValue(id, mPlatformResourceFlag); + IResourceValue resValue = getResourceValue(id, mPlatformResourceFlag); - if (value != null) { - try { - int color = ResourceHelper.getColor(value.getValue()); - return ColorStateList.valueOf(color); - } catch (NumberFormatException e) { - return null; + if (resValue != null) { + String value = resValue.getValue(); + if (value != null) { + // first check if the value is a file (xml most likely) + File f = new File(value); + if (f.isFile()) { + try { + // let the framework inflate the ColorStateList from the XML file, by + // providing an XmlPullParser + KXmlParser parser = new KXmlParser(); + parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true); + parser.setInput(new FileReader(f)); + + return ColorStateList.createFromXml(this, + new BridgeXmlBlockParser(parser, mContext, resValue.isFramework())); + } catch (XmlPullParserException e) { + mContext.getLogger().error(e); + } catch (FileNotFoundException e) { + // will not happen, since we pre-check + } catch (IOException e) { + mContext.getLogger().error(e); + } + + } else { + // try to load the color state list from an int + try { + int color = ResourceHelper.getColor(value); + return ColorStateList.valueOf(color); + } catch (NumberFormatException e) { + return null; + } + } } } |
