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

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

Clean up some options menu/action bar menu handling for Dialogs.

Add Dialog#invalidateOptionsMenu so that dialogs hosting action bars
have a way to request a refresh of menu content.

Change-Id: I73aa22c2df1c5e60b94035e30af548f87073dbb9
parent b04f7ad9
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -26619,6 +26619,17 @@
 visibility="public"
>
</method>
<method name="invalidateOptionsMenu"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="isShowing"
 return="boolean"
 abstract="false"
+10 −0
Original line number Diff line number Diff line
@@ -228,6 +228,9 @@ public class Dialog implements DialogInterface, Window.Callback,
    public void show() {
        if (mShowing) {
            if (mDecor != null) {
                if (mWindow.hasFeature(Window.FEATURE_ACTION_BAR)) {
                    mWindow.invalidatePanelMenu(Window.FEATURE_ACTION_BAR);
                }
                mDecor.setVisibility(View.VISIBLE);
            }
            return;
@@ -791,6 +794,13 @@ public class Dialog implements DialogInterface, Window.Callback,
        mWindow.closePanel(Window.FEATURE_OPTIONS_PANEL);
    }

    /**
     * @see Activity#invalidateOptionsMenu()
     */
    public void invalidateOptionsMenu() {
        mWindow.invalidatePanelMenu(Window.FEATURE_OPTIONS_PANEL);
    }

    /**
     * @see Activity#onCreateContextMenu(ContextMenu, View, ContextMenuInfo)
     */