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

Commit b366bbae authored by Adam Powell's avatar Adam Powell
Browse files

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

Change-Id: I393f041efef3852b7f3ee57c6a4c26ba176b2702
parent 7bb66f32
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);
    }