Loading core/java/com/android/internal/view/menu/ActionMenuView.java +4 −3 Original line number Diff line number Diff line Loading @@ -66,11 +66,12 @@ public class ActionMenuView extends LinearLayout implements MenuBuilder.ItemInvo } public void run() { if (mPopup.tryShow()) { mOverflowPopup = mPopup; mPopup.show(); mPostedOpenRunnable = null; } } } private OpenOverflowRunnable mPostedOpenRunnable; Loading core/java/com/android/internal/view/menu/MenuPopupHelper.java +8 −1 Original line number Diff line number Diff line Loading @@ -69,6 +69,12 @@ public class MenuPopupHelper implements AdapterView.OnItemClickListener, View.On } public void show() { if (!tryShow()) { throw new IllegalStateException("MenuPopupHelper cannot be used without an anchor"); } } public boolean tryShow() { mPopup = new ListPopupWindow(mContext, null, com.android.internal.R.attr.popupMenuStyle); mPopup.setOnItemClickListener(this); mPopup.setOnDismissListener(this); Loading @@ -92,13 +98,14 @@ public class MenuPopupHelper implements AdapterView.OnItemClickListener, View.On mTreeObserver.addOnGlobalLayoutListener(this); mPopup.setAnchorView(anchor); } else { throw new IllegalStateException("MenuPopupHelper cannot be used without an anchor"); return false; } mPopup.setContentWidth(Math.min(measureContentWidth(adapter), mPopupMaxWidth)); mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NOT_NEEDED); mPopup.show(); mPopup.getListView().setOnKeyListener(this); return true; } public void dismiss() { Loading policy/src/com/android/internal/policy/impl/PhoneWindow.java +5 −4 Original line number Diff line number Diff line Loading @@ -3007,7 +3007,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { @Override public void run() { show(); if (tryShow()) { Callback cb = getCallback(); if (cb != null) { cb.onMenuOpened(FEATURE_ACTION_BAR, mSubMenu); Loading @@ -3015,3 +3015,4 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } } } } Loading
core/java/com/android/internal/view/menu/ActionMenuView.java +4 −3 Original line number Diff line number Diff line Loading @@ -66,11 +66,12 @@ public class ActionMenuView extends LinearLayout implements MenuBuilder.ItemInvo } public void run() { if (mPopup.tryShow()) { mOverflowPopup = mPopup; mPopup.show(); mPostedOpenRunnable = null; } } } private OpenOverflowRunnable mPostedOpenRunnable; Loading
core/java/com/android/internal/view/menu/MenuPopupHelper.java +8 −1 Original line number Diff line number Diff line Loading @@ -69,6 +69,12 @@ public class MenuPopupHelper implements AdapterView.OnItemClickListener, View.On } public void show() { if (!tryShow()) { throw new IllegalStateException("MenuPopupHelper cannot be used without an anchor"); } } public boolean tryShow() { mPopup = new ListPopupWindow(mContext, null, com.android.internal.R.attr.popupMenuStyle); mPopup.setOnItemClickListener(this); mPopup.setOnDismissListener(this); Loading @@ -92,13 +98,14 @@ public class MenuPopupHelper implements AdapterView.OnItemClickListener, View.On mTreeObserver.addOnGlobalLayoutListener(this); mPopup.setAnchorView(anchor); } else { throw new IllegalStateException("MenuPopupHelper cannot be used without an anchor"); return false; } mPopup.setContentWidth(Math.min(measureContentWidth(adapter), mPopupMaxWidth)); mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NOT_NEEDED); mPopup.show(); mPopup.getListView().setOnKeyListener(this); return true; } public void dismiss() { Loading
policy/src/com/android/internal/policy/impl/PhoneWindow.java +5 −4 Original line number Diff line number Diff line Loading @@ -3007,7 +3007,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { @Override public void run() { show(); if (tryShow()) { Callback cb = getCallback(); if (cb != null) { cb.onMenuOpened(FEATURE_ACTION_BAR, mSubMenu); Loading @@ -3015,3 +3015,4 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback { } } } }