Loading core/java/com/android/internal/view/menu/ActionMenuPresenter.java +10 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ public class ActionMenuPresenter extends BaseMenuPresenter { private boolean mMaxItemsSet; private boolean mStrictWidthLimit; private boolean mWidthLimitSet; private boolean mExpandedActionViewsExclusive; private int mMinCellSize; Loading Loading @@ -124,6 +125,10 @@ public class ActionMenuPresenter extends BaseMenuPresenter { mMaxItemsSet = true; } public void setExpandedActionViewsExclusive(boolean isExclusive) { mExpandedActionViewsExclusive = isExclusive; } @Override public MenuView getMenuView(ViewGroup root) { MenuView result = super.getMenuView(root); Loading Loading @@ -326,6 +331,11 @@ public class ActionMenuPresenter extends BaseMenuPresenter { } else { hasOverflow = true; } if (mExpandedActionViewsExclusive && item.isActionViewExpanded()) { // Overflow everything if we have an expanded action view and we're // space constrained. maxActions = 0; } } // Reserve a spot for the overflow item if needed. Loading core/java/com/android/internal/widget/ActionBarView.java +4 −0 Original line number Diff line number Diff line Loading @@ -345,11 +345,15 @@ public class ActionBarView extends AbsActionBarView { final LayoutParams layoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT); if (!mSplitActionBar) { mActionMenuPresenter.setExpandedActionViewsExclusive( getResources().getBoolean( com.android.internal.R.bool.action_bar_expanded_action_views_exclusive)); builder.addMenuPresenter(mActionMenuPresenter); builder.addMenuPresenter(mExpandedMenuPresenter); menuView = (ActionMenuView) mActionMenuPresenter.getMenuView(this); addView(menuView, layoutParams); } else { mActionMenuPresenter.setExpandedActionViewsExclusive(false); // Allow full screen width in split mode. mActionMenuPresenter.setWidthLimit( getContext().getResources().getDisplayMetrics().widthPixels, true); Loading core/res/res/values-sw600dp/bools.xml +1 −0 Original line number Diff line number Diff line Loading @@ -17,4 +17,5 @@ <resources> <bool name="preferences_prefer_dual_pane">true</bool> <bool name="show_ongoing_ime_switcher">false</bool> <bool name="action_bar_expanded_action_views_exclusive">false</bool> </resources> core/res/res/values/bools.xml +1 −0 Original line number Diff line number Diff line Loading @@ -19,4 +19,5 @@ <bool name="split_action_bar_is_narrow">true</bool> <bool name="preferences_prefer_dual_pane">false</bool> <bool name="show_ongoing_ime_switcher">true</bool> <bool name="action_bar_expanded_action_views_exclusive">true</bool> </resources> Loading
core/java/com/android/internal/view/menu/ActionMenuPresenter.java +10 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ public class ActionMenuPresenter extends BaseMenuPresenter { private boolean mMaxItemsSet; private boolean mStrictWidthLimit; private boolean mWidthLimitSet; private boolean mExpandedActionViewsExclusive; private int mMinCellSize; Loading Loading @@ -124,6 +125,10 @@ public class ActionMenuPresenter extends BaseMenuPresenter { mMaxItemsSet = true; } public void setExpandedActionViewsExclusive(boolean isExclusive) { mExpandedActionViewsExclusive = isExclusive; } @Override public MenuView getMenuView(ViewGroup root) { MenuView result = super.getMenuView(root); Loading Loading @@ -326,6 +331,11 @@ public class ActionMenuPresenter extends BaseMenuPresenter { } else { hasOverflow = true; } if (mExpandedActionViewsExclusive && item.isActionViewExpanded()) { // Overflow everything if we have an expanded action view and we're // space constrained. maxActions = 0; } } // Reserve a spot for the overflow item if needed. Loading
core/java/com/android/internal/widget/ActionBarView.java +4 −0 Original line number Diff line number Diff line Loading @@ -345,11 +345,15 @@ public class ActionBarView extends AbsActionBarView { final LayoutParams layoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT); if (!mSplitActionBar) { mActionMenuPresenter.setExpandedActionViewsExclusive( getResources().getBoolean( com.android.internal.R.bool.action_bar_expanded_action_views_exclusive)); builder.addMenuPresenter(mActionMenuPresenter); builder.addMenuPresenter(mExpandedMenuPresenter); menuView = (ActionMenuView) mActionMenuPresenter.getMenuView(this); addView(menuView, layoutParams); } else { mActionMenuPresenter.setExpandedActionViewsExclusive(false); // Allow full screen width in split mode. mActionMenuPresenter.setWidthLimit( getContext().getResources().getDisplayMetrics().widthPixels, true); Loading
core/res/res/values-sw600dp/bools.xml +1 −0 Original line number Diff line number Diff line Loading @@ -17,4 +17,5 @@ <resources> <bool name="preferences_prefer_dual_pane">true</bool> <bool name="show_ongoing_ime_switcher">false</bool> <bool name="action_bar_expanded_action_views_exclusive">false</bool> </resources>
core/res/res/values/bools.xml +1 −0 Original line number Diff line number Diff line Loading @@ -19,4 +19,5 @@ <bool name="split_action_bar_is_narrow">true</bool> <bool name="preferences_prefer_dual_pane">false</bool> <bool name="show_ongoing_ime_switcher">true</bool> <bool name="action_bar_expanded_action_views_exclusive">true</bool> </resources>