Loading core/java/com/android/internal/app/ActionBarImpl.java +3 −3 Original line number Diff line number Diff line Loading @@ -368,7 +368,7 @@ public class ActionBarImpl extends ActionBar { mode.invalidate(); mContextView.initForMode(mode); animateToMode(true); if (mSplitView != null) { if (mSplitView != null && mContextDisplayMode == CONTEXT_DISPLAY_SPLIT) { // TODO animate this mSplitView.setVisibility(View.VISIBLE); } Loading Loading @@ -526,7 +526,7 @@ public class ActionBarImpl extends ActionBar { mContainerView.setTranslationY(-mContainerView.getHeight()); b.with(ObjectAnimator.ofFloat(mContainerView, "translationY", 0)); } if (mSplitView != null) { if (mSplitView != null && mContextDisplayMode == CONTEXT_DISPLAY_SPLIT) { mSplitView.setAlpha(0); b.with(ObjectAnimator.ofFloat(mSplitView, "alpha", 1)); } Loading Loading @@ -560,7 +560,7 @@ public class ActionBarImpl extends ActionBar { b.with(ObjectAnimator.ofFloat(mContainerView, "translationY", -mContainerView.getHeight())); } if (mSplitView != null) { if (mSplitView != null && mSplitView.getVisibility() == View.VISIBLE) { mSplitView.setAlpha(1); b.with(ObjectAnimator.ofFloat(mSplitView, "alpha", 0)); } Loading core/java/com/android/internal/view/menu/ActionMenuPresenter.java +24 −10 Original line number Diff line number Diff line Loading @@ -39,10 +39,13 @@ public class ActionMenuPresenter extends BaseMenuPresenter { private View mOverflowButton; private boolean mReserveOverflow; private boolean mReserveOverflowSet; private int mWidthLimit; private int mActionItemWidthLimit; private int mMaxItems; private boolean mMaxItemsSet; private boolean mStrictWidthLimit; private boolean mWidthLimitSet; // Group IDs that have been added as actions - used temporarily, allocated here for reuse. private final SparseBooleanArray mActionButtonGroups = new SparseBooleanArray(); Loading @@ -64,14 +67,21 @@ public class ActionMenuPresenter extends BaseMenuPresenter { super.initForMenu(context, menu); final Resources res = context.getResources(); final int screen = res.getConfiguration().screenLayout; if (!mReserveOverflowSet) { // TODO Use the no-buttons specifier instead here mReserveOverflow = (screen & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_XLARGE; mReserveOverflow = res.getConfiguration() .isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_LARGE); } if (!mWidthLimitSet) { mWidthLimit = res.getDisplayMetrics().widthPixels / 2; } // Measure for initial configuration if (!mMaxItemsSet) { mMaxItems = res.getInteger(com.android.internal.R.integer.max_action_buttons); } int width = mWidthLimit; if (mReserveOverflow) { Loading @@ -92,15 +102,19 @@ public class ActionMenuPresenter extends BaseMenuPresenter { } public void setWidthLimit(int width, boolean strict) { if (mReserveOverflow) { width -= mOverflowButton.getMeasuredWidth(); } mActionItemWidthLimit = width; mWidthLimit = width; mStrictWidthLimit = strict; mWidthLimitSet = true; } public void setReserveOverflow(boolean reserveOverflow) { mReserveOverflow = reserveOverflow; mReserveOverflowSet = true; } public void setItemLimit(int itemCount) { mMaxItems = itemCount; mMaxItemsSet = true; } @Override Loading core/java/com/android/internal/widget/ActionBarContextView.java +8 −5 Original line number Diff line number Diff line Loading @@ -168,14 +168,14 @@ public class ActionBarContextView extends AbsActionBarView implements AnimatorLi final MenuBuilder menu = (MenuBuilder) mode.getMenu(); mActionMenuPresenter = new ActionMenuPresenter(); menu.addMenuPresenter(mActionMenuPresenter); mMenuView = (ActionMenuView) mActionMenuPresenter.getMenuView(this); mActionMenuPresenter.setReserveOverflow(true); final LayoutParams layoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT); mMenuView.setLayoutParams(layoutParams); if (mSplitView == null) { addView(mMenuView); menu.addMenuPresenter(mActionMenuPresenter); mMenuView = (ActionMenuView) mActionMenuPresenter.getMenuView(this); addView(mMenuView, layoutParams); } else { // Allow full screen width in split mode. mActionMenuPresenter.setWidthLimit( Loading @@ -184,7 +184,10 @@ public class ActionBarContextView extends AbsActionBarView implements AnimatorLi mActionMenuPresenter.setItemLimit(Integer.MAX_VALUE); // Span the whole width layoutParams.width = LayoutParams.MATCH_PARENT; mSplitView.addView(mMenuView); layoutParams.height = mContentHeight; menu.addMenuPresenter(mActionMenuPresenter); mMenuView = (ActionMenuView) mActionMenuPresenter.getMenuView(this); mSplitView.addView(mMenuView, layoutParams); } mAnimateInOnLayout = true; Loading core/java/com/android/internal/widget/ActionBarView.java +13 −7 Original line number Diff line number Diff line Loading @@ -327,15 +327,15 @@ public class ActionBarView extends AbsActionBarView { mActionMenuPresenter.setCallback(cb); mExpandedMenuPresenter = new ExpandedActionViewMenuPresenter(); } builder.addMenuPresenter(mActionMenuPresenter); builder.addMenuPresenter(mExpandedMenuPresenter); final ActionMenuView menuView = (ActionMenuView) mActionMenuPresenter.getMenuView(this); ActionMenuView menuView; final LayoutParams layoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT); menuView.setLayoutParams(layoutParams); if (!mSplitActionBar) { addView(menuView); builder.addMenuPresenter(mActionMenuPresenter); builder.addMenuPresenter(mExpandedMenuPresenter); menuView = (ActionMenuView) mActionMenuPresenter.getMenuView(this); addView(menuView, layoutParams); } else { // Allow full screen width in split mode. mActionMenuPresenter.setWidthLimit( Loading @@ -344,9 +344,15 @@ public class ActionBarView extends AbsActionBarView { mActionMenuPresenter.setItemLimit(Integer.MAX_VALUE); // Span the whole width layoutParams.width = LayoutParams.MATCH_PARENT; builder.addMenuPresenter(mActionMenuPresenter); builder.addMenuPresenter(mExpandedMenuPresenter); menuView = (ActionMenuView) mActionMenuPresenter.getMenuView(this); if (mSplitView != null) { mSplitView.addView(menuView); } // We'll add this later if we missed it this time. mSplitView.addView(menuView, layoutParams); } else { // We'll add this later if we missed it this time. menuView.setLayoutParams(layoutParams); } } mMenuView = menuView; } Loading Loading
core/java/com/android/internal/app/ActionBarImpl.java +3 −3 Original line number Diff line number Diff line Loading @@ -368,7 +368,7 @@ public class ActionBarImpl extends ActionBar { mode.invalidate(); mContextView.initForMode(mode); animateToMode(true); if (mSplitView != null) { if (mSplitView != null && mContextDisplayMode == CONTEXT_DISPLAY_SPLIT) { // TODO animate this mSplitView.setVisibility(View.VISIBLE); } Loading Loading @@ -526,7 +526,7 @@ public class ActionBarImpl extends ActionBar { mContainerView.setTranslationY(-mContainerView.getHeight()); b.with(ObjectAnimator.ofFloat(mContainerView, "translationY", 0)); } if (mSplitView != null) { if (mSplitView != null && mContextDisplayMode == CONTEXT_DISPLAY_SPLIT) { mSplitView.setAlpha(0); b.with(ObjectAnimator.ofFloat(mSplitView, "alpha", 1)); } Loading Loading @@ -560,7 +560,7 @@ public class ActionBarImpl extends ActionBar { b.with(ObjectAnimator.ofFloat(mContainerView, "translationY", -mContainerView.getHeight())); } if (mSplitView != null) { if (mSplitView != null && mSplitView.getVisibility() == View.VISIBLE) { mSplitView.setAlpha(1); b.with(ObjectAnimator.ofFloat(mSplitView, "alpha", 0)); } Loading
core/java/com/android/internal/view/menu/ActionMenuPresenter.java +24 −10 Original line number Diff line number Diff line Loading @@ -39,10 +39,13 @@ public class ActionMenuPresenter extends BaseMenuPresenter { private View mOverflowButton; private boolean mReserveOverflow; private boolean mReserveOverflowSet; private int mWidthLimit; private int mActionItemWidthLimit; private int mMaxItems; private boolean mMaxItemsSet; private boolean mStrictWidthLimit; private boolean mWidthLimitSet; // Group IDs that have been added as actions - used temporarily, allocated here for reuse. private final SparseBooleanArray mActionButtonGroups = new SparseBooleanArray(); Loading @@ -64,14 +67,21 @@ public class ActionMenuPresenter extends BaseMenuPresenter { super.initForMenu(context, menu); final Resources res = context.getResources(); final int screen = res.getConfiguration().screenLayout; if (!mReserveOverflowSet) { // TODO Use the no-buttons specifier instead here mReserveOverflow = (screen & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_XLARGE; mReserveOverflow = res.getConfiguration() .isLayoutSizeAtLeast(Configuration.SCREENLAYOUT_SIZE_LARGE); } if (!mWidthLimitSet) { mWidthLimit = res.getDisplayMetrics().widthPixels / 2; } // Measure for initial configuration if (!mMaxItemsSet) { mMaxItems = res.getInteger(com.android.internal.R.integer.max_action_buttons); } int width = mWidthLimit; if (mReserveOverflow) { Loading @@ -92,15 +102,19 @@ public class ActionMenuPresenter extends BaseMenuPresenter { } public void setWidthLimit(int width, boolean strict) { if (mReserveOverflow) { width -= mOverflowButton.getMeasuredWidth(); } mActionItemWidthLimit = width; mWidthLimit = width; mStrictWidthLimit = strict; mWidthLimitSet = true; } public void setReserveOverflow(boolean reserveOverflow) { mReserveOverflow = reserveOverflow; mReserveOverflowSet = true; } public void setItemLimit(int itemCount) { mMaxItems = itemCount; mMaxItemsSet = true; } @Override Loading
core/java/com/android/internal/widget/ActionBarContextView.java +8 −5 Original line number Diff line number Diff line Loading @@ -168,14 +168,14 @@ public class ActionBarContextView extends AbsActionBarView implements AnimatorLi final MenuBuilder menu = (MenuBuilder) mode.getMenu(); mActionMenuPresenter = new ActionMenuPresenter(); menu.addMenuPresenter(mActionMenuPresenter); mMenuView = (ActionMenuView) mActionMenuPresenter.getMenuView(this); mActionMenuPresenter.setReserveOverflow(true); final LayoutParams layoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT); mMenuView.setLayoutParams(layoutParams); if (mSplitView == null) { addView(mMenuView); menu.addMenuPresenter(mActionMenuPresenter); mMenuView = (ActionMenuView) mActionMenuPresenter.getMenuView(this); addView(mMenuView, layoutParams); } else { // Allow full screen width in split mode. mActionMenuPresenter.setWidthLimit( Loading @@ -184,7 +184,10 @@ public class ActionBarContextView extends AbsActionBarView implements AnimatorLi mActionMenuPresenter.setItemLimit(Integer.MAX_VALUE); // Span the whole width layoutParams.width = LayoutParams.MATCH_PARENT; mSplitView.addView(mMenuView); layoutParams.height = mContentHeight; menu.addMenuPresenter(mActionMenuPresenter); mMenuView = (ActionMenuView) mActionMenuPresenter.getMenuView(this); mSplitView.addView(mMenuView, layoutParams); } mAnimateInOnLayout = true; Loading
core/java/com/android/internal/widget/ActionBarView.java +13 −7 Original line number Diff line number Diff line Loading @@ -327,15 +327,15 @@ public class ActionBarView extends AbsActionBarView { mActionMenuPresenter.setCallback(cb); mExpandedMenuPresenter = new ExpandedActionViewMenuPresenter(); } builder.addMenuPresenter(mActionMenuPresenter); builder.addMenuPresenter(mExpandedMenuPresenter); final ActionMenuView menuView = (ActionMenuView) mActionMenuPresenter.getMenuView(this); ActionMenuView menuView; final LayoutParams layoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT); menuView.setLayoutParams(layoutParams); if (!mSplitActionBar) { addView(menuView); builder.addMenuPresenter(mActionMenuPresenter); builder.addMenuPresenter(mExpandedMenuPresenter); menuView = (ActionMenuView) mActionMenuPresenter.getMenuView(this); addView(menuView, layoutParams); } else { // Allow full screen width in split mode. mActionMenuPresenter.setWidthLimit( Loading @@ -344,9 +344,15 @@ public class ActionBarView extends AbsActionBarView { mActionMenuPresenter.setItemLimit(Integer.MAX_VALUE); // Span the whole width layoutParams.width = LayoutParams.MATCH_PARENT; builder.addMenuPresenter(mActionMenuPresenter); builder.addMenuPresenter(mExpandedMenuPresenter); menuView = (ActionMenuView) mActionMenuPresenter.getMenuView(this); if (mSplitView != null) { mSplitView.addView(menuView); } // We'll add this later if we missed it this time. mSplitView.addView(menuView, layoutParams); } else { // We'll add this later if we missed it this time. menuView.setLayoutParams(layoutParams); } } mMenuView = menuView; } Loading