diff options
author | Adam Powell <adamp@google.com> | 2011-06-17 16:03:40 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-06-17 16:03:40 -0700 |
commit | ec08cacd78c4b746ac385c874f41833fc06ebc2f (patch) | |
tree | e050fb519f2b9c7294035cca76e67efc4a39d215 | |
parent | 1790a10eea34b777dcca54cfafb05ef4914b23fb (diff) | |
parent | 38639b1d75933bfb720db79fce26f09478709614 (diff) | |
download | frameworks_base-ec08cacd78c4b746ac385c874f41833fc06ebc2f.zip frameworks_base-ec08cacd78c4b746ac385c874f41833fc06ebc2f.tar.gz frameworks_base-ec08cacd78c4b746ac385c874f41833fc06ebc2f.tar.bz2 |
Merge "Fix bug 4689431 - PopupMenus too narrow on phones"
-rw-r--r-- | core/java/com/android/internal/view/menu/MenuPopupHelper.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/java/com/android/internal/view/menu/MenuPopupHelper.java b/core/java/com/android/internal/view/menu/MenuPopupHelper.java index 5767519..8db7e3c 100644 --- a/core/java/com/android/internal/view/menu/MenuPopupHelper.java +++ b/core/java/com/android/internal/view/menu/MenuPopupHelper.java @@ -17,6 +17,7 @@ package com.android.internal.view.menu; import android.content.Context; +import android.content.res.Resources; import android.util.DisplayMetrics; import android.view.KeyEvent; import android.view.LayoutInflater; @@ -71,8 +72,9 @@ public class MenuPopupHelper implements AdapterView.OnItemClickListener, View.On mMenu = menu; mOverflowOnly = overflowOnly; - final DisplayMetrics metrics = context.getResources().getDisplayMetrics(); - mPopupMaxWidth = metrics.widthPixels / 2; + final Resources res = context.getResources(); + mPopupMaxWidth = Math.max(res.getDisplayMetrics().widthPixels / 2, + res.getDimensionPixelSize(com.android.internal.R.dimen.config_prefDialogWidth)); mAnchorView = anchorView; |