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

Commit 38639b1d authored by Adam Powell's avatar Adam Powell
Browse files

Fix bug 4689431 - PopupMenus too narrow on phones

Change-Id: I624b46d17c1d964fd6cb04abf96333c7a8474d75
parent 09b8a555
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.internal.view.menu;

import android.content.Context;
import android.content.res.Resources;
import android.util.DisplayMetrics;
import android.view.KeyEvent;
import android.view.LayoutInflater;
@@ -71,8 +72,9 @@ public class MenuPopupHelper implements AdapterView.OnItemClickListener, View.On
        mMenu = menu;
        mOverflowOnly = overflowOnly;

        final DisplayMetrics metrics = context.getResources().getDisplayMetrics();
        mPopupMaxWidth = metrics.widthPixels / 2;
        final Resources res = context.getResources();
        mPopupMaxWidth = Math.max(res.getDisplayMetrics().widthPixels / 2,
                res.getDimensionPixelSize(com.android.internal.R.dimen.config_prefDialogWidth));

        mAnchorView = anchorView;