From e8d153673bdbbb113559ad592ad8a4e92e8d0d7e Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Tue, 9 Sep 2014 13:51:16 -0700 Subject: ActionMenuViews always reserve overflow when creating their own menus ActionMenuViews work in two modes: hosting another Menu instance or creating their own. The former is used when an action bar is displaying a window's options menu. The latter is used when an ActionMenuView (or Toolbar) is placed within an arbitrary layout and the getMenu method is called. When showing a window's options menu, ActionMenuPresenter calls into the ActionBarPolicy to determine if we should reserve an overflow button or if overflow will be presented by the window instead. Always reserve overflow if the ActionMenuView is presenting its own menu. Bug 17381966 Change-Id: I17c495986994d421bf6276ae39ba233243432e97 --- core/java/android/widget/ActionMenuView.java | 1 + 1 file changed, 1 insertion(+) (limited to 'core/java/android/widget/ActionMenuView.java') diff --git a/core/java/android/widget/ActionMenuView.java b/core/java/android/widget/ActionMenuView.java index 6ca4a9e..7198e52 100644 --- a/core/java/android/widget/ActionMenuView.java +++ b/core/java/android/widget/ActionMenuView.java @@ -611,6 +611,7 @@ public class ActionMenuView extends LinearLayout implements MenuBuilder.ItemInvo mMenu = new MenuBuilder(context); mMenu.setCallback(new MenuBuilderCallback()); mPresenter = new ActionMenuPresenter(context); + mPresenter.setReserveOverflow(true); mPresenter.setCallback(mActionMenuPresenterCallback != null ? mActionMenuPresenterCallback : new ActionMenuPresenterCallback()); mMenu.addMenuPresenter(mPresenter, mPopupContext); -- cgit v1.1