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

Commit 0049338b authored by Alan Viverette's avatar Alan Viverette Committed by Android Git Automerger
Browse files

am e71c6e38: Merge "Constrain ListPopupWindow hint width spec to >= 0" into mnc-dev

* commit 'e71c6e38':
  Constrain ListPopupWindow hint width spec to >= 0
parents 386dbb89 e71c6e38
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
@@ -1127,10 +1127,19 @@ public class ListPopupWindow {
                    break;
                }

                // measure the hint's height to find how much more vertical space
                // we need to add to the drop down's height
                int widthSpec = MeasureSpec.makeMeasureSpec(mDropDownWidth, MeasureSpec.AT_MOST);
                int heightSpec = MeasureSpec.UNSPECIFIED;
                // Measure the hint's height to find how much more vertical
                // space we need to add to the drop down's height.
                final int widthSize;
                final int widthMode;
                if (mDropDownWidth >= 0) {
                    widthMode = MeasureSpec.AT_MOST;
                    widthSize = mDropDownWidth;
                } else {
                    widthMode = MeasureSpec.UNSPECIFIED;
                    widthSize = 0;
                }
                final int widthSpec = MeasureSpec.makeMeasureSpec(widthSize, widthMode);
                final int heightSpec = MeasureSpec.UNSPECIFIED;
                hintView.measure(widthSpec, heightSpec);

                hintParams = (LinearLayout.LayoutParams) hintView.getLayoutParams();