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

Commit 9d9430e7 authored by Evan Rosky's avatar Evan Rosky Committed by Android (Google) Code Review
Browse files

Merge "Hooked-up options menu closing"

parents 38691e9d 41823d19
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1068,6 +1068,11 @@ public abstract class ActionBar {
        return false;
    }

    /** @hide */
    public boolean closeOptionsMenu() {
        return false;
    }

    /** @hide */
    public boolean invalidateOptionsMenu() {
        return false;
+2 −1
Original line number Diff line number Diff line
@@ -3557,7 +3557,8 @@ public class Activity extends ContextThemeWrapper
     * closed, this method does nothing.
     */
    public void closeOptionsMenu() {
        if (mWindow.hasFeature(Window.FEATURE_OPTIONS_PANEL)) {
        if (mWindow.hasFeature(Window.FEATURE_OPTIONS_PANEL) &&
                (mActionBar == null || !mActionBar.closeOptionsMenu())) {
            mWindow.closePanel(Window.FEATURE_OPTIONS_PANEL);
        }
    }
+5 −0
Original line number Diff line number Diff line
@@ -418,6 +418,11 @@ public class ToolbarActionBar extends ActionBar {
        return mDecorToolbar.showOverflowMenu();
    }

    @Override
    public boolean closeOptionsMenu() {
        return mDecorToolbar.hideOverflowMenu();
    }

    @Override
    public boolean invalidateOptionsMenu() {
        mDecorToolbar.getViewGroup().removeCallbacks(mMenuInvalidator);
+3 −1
Original line number Diff line number Diff line
@@ -441,9 +441,11 @@ final class CascadingMenuPopup extends MenuPopup implements MenuPresenter, OnKey

        popupWindow.show();

        final ListView listView = popupWindow.getListView();
        listView.setOnKeyListener(this);

        // If this is the root menu, show the title if requested.
        if (parentInfo == null && mShowTitle && menu.getHeaderTitle() != null) {
            final ListView listView = popupWindow.getListView();
            final FrameLayout titleItemView = (FrameLayout) inflater.inflate(
                    R.layout.popup_menu_header_item_layout, listView, false);
            final TextView titleView = (TextView) titleItemView.findViewById(R.id.title);