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

Commit 9a33bda0 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add @TestApi PopupMenu.getMenuListView"

parents 05aa9e6f f087a175
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -48823,6 +48823,7 @@ package android.widget {
    method public int getGravity();
    method public android.view.Menu getMenu();
    method public android.view.MenuInflater getMenuInflater();
    method public android.widget.ListView getMenuListView();
    method public void inflate(int);
    method public void setGravity(int);
    method public void setOnDismissListener(android.widget.PopupMenu.OnDismissListener);
+16 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.widget;

import android.annotation.MenuRes;
import android.annotation.TestApi;
import android.content.Context;
import android.view.Gravity;
import android.view.Menu;
@@ -281,4 +282,19 @@ public class PopupMenu {
         */
        void onDismiss(PopupMenu menu);
    }

    /**
     * Returns the {@link ListView} representing the list of menu items in the currently showing
     * menu.
     *
     * @return The view representing the list of menu items.
     * @hide
     */
    @TestApi
    public ListView getMenuListView() {
        if (!mPopup.isShowing()) {
            return null;
        }
        return mPopup.getPopup().getListView();
    }
}