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

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

Merge "Add PopupMenu#setForceShowIcon"

parents b8accfe7 da59e1da
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -56262,6 +56262,7 @@ package android.widget {
    method public android.view.Menu getMenu();
    method public android.view.MenuInflater getMenuInflater();
    method public void inflate(@MenuRes int);
    method public void setForceShowIcon(boolean);
    method public void setGravity(int);
    method public void setOnDismissListener(android.widget.PopupMenu.OnDismissListener);
    method public void setOnMenuItemClickListener(android.widget.PopupMenu.OnMenuItemClickListener);
+13 −0
Original line number Diff line number Diff line
@@ -258,6 +258,19 @@ public class PopupMenu {
        mOnDismissListener = listener;
    }

    /**
     * Sets whether the popup menu's adapter is forced to show icons in the
     * menu item views.
     * <p>
     * Changes take effect on the next call to show().
     *
     * @param forceShowIcon {@code true} to force icons to be shown, or
     *                  {@code false} for icons to be optionally shown
     */
    public void setForceShowIcon(boolean forceShowIcon) {
        mPopup.setForceShowIcon(forceShowIcon);
    }

    /**
     * Interface responsible for receiving menu item click events if the items
     * themselves do not have individual item click listeners.
+5 −1
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import android.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.graphics.Point;
import android.graphics.Rect;
import android.os.Build;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.Gravity;
@@ -107,10 +108,13 @@ public class MenuPopupHelper implements MenuHelper {
     * <p>
     * Changes take effect on the next call to show().
     *
     * This method should not be accessed directly outside the framework, please use
     * {@link android.widget.PopupMenu#setForceShowIcon(boolean)} instead.
     *
     * @param forceShowIcon {@code true} to force icons to be shown, or
     *                  {@code false} for icons to be optionally shown
     */
    @UnsupportedAppUsage
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
    public void setForceShowIcon(boolean forceShowIcon) {
        mForceShowIcon = forceShowIcon;
        if (mPopup != null) {