From dfee59afb3e4cdcde38f6338f9360655de76da92 Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Fri, 5 Aug 2011 20:48:30 -0700 Subject: Fix bug 5011824 - New Holo overflow menu for physical menu key devices The new Holo-style overflow menu now appears from the edge of the screen where the device's physical menu key can be found. The policy determining this lives in getPreferredOptionsPanelGravity() in WindowManagerService. Change-Id: I8851a2265547156591e82044e50b5cfc58d3eefa --- core/java/android/view/IWindowManager.aidl | 7 ++++++ core/res/res/layout/expanded_menu_layout.xml | 2 +- core/res/res/layout/list_menu_item_layout.xml | 2 +- core/res/res/values/attrs.xml | 4 ++++ core/res/res/values/themes.xml | 31 +++++++++++++++++++++++++-- 5 files changed, 42 insertions(+), 4 deletions(-) (limited to 'core') diff --git a/core/java/android/view/IWindowManager.aidl b/core/java/android/view/IWindowManager.aidl index 81cd798..c7bf8e3 100644 --- a/core/java/android/view/IWindowManager.aidl +++ b/core/java/android/view/IWindowManager.aidl @@ -184,6 +184,13 @@ interface IWindowManager */ int watchRotation(IRotationWatcher watcher); + /** + * Determine the preferred edge of the screen to pin the compact options menu against. + * @return a Gravity value for the options menu panel + * @hide + */ + int getPreferredOptionsPanelGravity(); + /** * Lock the device orientation to the current rotation. Sensor input will * be ignored until thawRotation() is called. diff --git a/core/res/res/layout/expanded_menu_layout.xml b/core/res/res/layout/expanded_menu_layout.xml index 5d98773..f44a83f 100644 --- a/core/res/res/layout/expanded_menu_layout.xml +++ b/core/res/res/layout/expanded_menu_layout.xml @@ -16,5 +16,5 @@ diff --git a/core/res/res/layout/list_menu_item_layout.xml b/core/res/res/layout/list_menu_item_layout.xml index 57091a1..aaff4c7 100644 --- a/core/res/res/layout/list_menu_item_layout.xml +++ b/core/res/res/layout/list_menu_item_layout.xml @@ -16,7 +16,7 @@ + android:layout_height="?android:attr/listPreferredItemHeightSmall"> diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index f70319b..eed41ea 100755 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -439,6 +439,10 @@ + + + + diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml index 615a37d..82299b8 100644 --- a/core/res/res/values/themes.xml +++ b/core/res/res/values/themes.xml @@ -185,6 +185,9 @@ please see themes_device_defaults.xml. ?android:attr/textColorPrimary ?android:attr/textAppearance + false + 296dip + 250 300 @@ -755,6 +758,22 @@ please see themes_device_defaults.xml. @null + + + +