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

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

Merge "Fix MenuItemImpl#hasCollapsibleActionView for action providers"

parents 414e2041 b4c8ba49
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -616,7 +616,7 @@ public final class MenuItemImpl implements MenuItem {

    @Override
    public boolean expandActionView() {
        if ((mShowAsAction & SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW) == 0 || mActionView == null) {
        if (hasCollapsibleActionView()) {
            return false;
        }

@@ -653,7 +653,13 @@ public final class MenuItemImpl implements MenuItem {
    }

    public boolean hasCollapsibleActionView() {
        return (mShowAsAction & SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW) != 0 && mActionView != null;
        if ((mShowAsAction & SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW) != 0) {
            if (mActionView == null && mActionProvider != null) {
                mActionView = mActionProvider.onCreateActionView(this);
            }
            return mActionView != null;
        }
        return false;
    }

    public void setActionViewExpanded(boolean isExpanded) {