Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e06193c authored by Adam Powell's avatar Adam Powell Committed by Android (Google) Code Review
Browse files

Merge "Make sure action bar context modes reserve space for overflow menus on all devices."

parents ab60d480 b366bbae
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -71,6 +71,10 @@ public class ActionMenuView extends LinearLayout implements MenuBuilder.ItemInvo
        return mReserveOverflow;
    }
    
    public void setOverflowReserved(boolean reserveOverflow) {
        mReserveOverflow = reserveOverflow;
    }

    @Override
    protected boolean checkLayoutParams(ViewGroup.LayoutParams p) {
        if (p instanceof LayoutParams) {
+4 −3
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
@@ -53,7 +52,7 @@ public class ActionBarContextView extends ViewGroup {
    private TextView mTitleView;
    private TextView mSubtitleView;
    private Drawable mCloseDrawable;
    private View mMenuView;
    private ActionMenuView mMenuView;
    
    public ActionBarContextView(Context context) {
        this(context, null, 0);
@@ -150,7 +149,9 @@ public class ActionBarContextView extends ViewGroup {
        addView(mCloseButton);

        final MenuBuilder menu = (MenuBuilder) mode.getMenu();
        mMenuView = menu.getMenuView(MenuBuilder.TYPE_ACTION_BUTTON, this);
        mMenuView = (ActionMenuView) menu.getMenuView(MenuBuilder.TYPE_ACTION_BUTTON, this);
        mMenuView.setOverflowReserved(true);
        mMenuView.updateChildren(false);
        addView(mMenuView);
    }