summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Adam Powell <adamp@google.com> 2011-06-22 11:21:54 -0700
committer Adam Powell <adamp@google.com> 2011-06-22 11:21:54 -0700
commita3e3c533ee4af6d9dba43b70ac421ba880992961 (patch)
tree654e9d5810090ee53532f8fa7babf44d24aa5708
parent8969d9924c662ab4cdacc342bbdc33756db730be (diff)
Fix bug 4807086 - Options menu panel too narrow in landscape
Now that landscape on phones uses the config_prefDialogWidth setting to restrict the default size of dialog windows, the options menu panel was affected. Restrict the ratcheting preferred width feature based on the width LayoutParam only, and respect the LayoutParams width provided by panel windows. Change-Id: Idc62f41910f6f22dc50cab978c5642bb0a8dbdaf
-rw-r--r--core/java/android/view/ViewAncestor.java3
-rw-r--r--policy/src/com/android/internal/policy/impl/PhoneWindow.java4
2 files changed, 4 insertions, 3 deletions
diff --git a/core/java/android/view/ViewAncestor.java b/core/java/android/view/ViewAncestor.java
index afbedafa6eac..40e99a1788c2 100644
--- a/core/java/android/view/ViewAncestor.java
+++ b/core/java/android/view/ViewAncestor.java
@@ -1000,8 +1000,7 @@ public final class ViewAncestor extends Handler implements ViewParent,
+ "x" + desiredWindowHeight + "...");
boolean goodMeasure = false;
- if (lp.width == ViewGroup.LayoutParams.WRAP_CONTENT
- || lp.height == ViewGroup.LayoutParams.WRAP_CONTENT) {
+ if (lp.width == ViewGroup.LayoutParams.WRAP_CONTENT) {
// On large screens, we don't want to allow dialogs to just
// stretch to fill the entire width of the screen to display
// one line of text. First try doing the layout at a smaller
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
index 75f466a35fdd..baa4ec398354 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindow.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindow.java
@@ -498,6 +498,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
return;
}
+ int width = WRAP_CONTENT;
if (st.decorView == null || st.refreshDecorView) {
if (st.decorView == null) {
// Initialize the panel decor, this will populate st.decorView
@@ -523,6 +524,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
// If the contents is fill parent for the width, set the
// corresponding background
backgroundResId = st.fullBackground;
+ width = MATCH_PARENT;
} else {
// Otherwise, set the normal panel background
backgroundResId = st.background;
@@ -546,7 +548,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
st.isHandled = false;
WindowManager.LayoutParams lp = new WindowManager.LayoutParams(
- WRAP_CONTENT, WRAP_CONTENT,
+ width, WRAP_CONTENT,
st.x, st.y, WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG,
WindowManager.LayoutParams.FLAG_DITHER
| WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM