am e71c6e38: Merge "Constrain ListPopupWindow hint width spec to >= 0" into mnc-dev
* commit 'e71c6e3832a963ed3cfa8c124374799f774eccb3': Constrain ListPopupWindow hint width spec to >= 0
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user