Fix wrong measurement in DecorView

Bug: 27215338
Change-Id: I512df9b23788daf485b020a2199a55a7c6ab6311
This commit is contained in:
Jorim Jaggi
2016-02-23 19:20:59 -05:00
parent eefb17ac61
commit ffd049027f

View File

@@ -585,14 +585,14 @@ public class DecorView extends FrameLayout implements RootViewSurfaceTaker, Wind
w = 0; w = 0;
} }
if (DEBUG_MEASURE) Log.d(mLogTag, "Fixed width: " + w); if (DEBUG_MEASURE) Log.d(mLogTag, "Fixed width: " + w);
if (w > 0) {
final int widthSize = MeasureSpec.getSize(widthMeasureSpec); final int widthSize = MeasureSpec.getSize(widthMeasureSpec);
if (w > 0) {
widthMeasureSpec = MeasureSpec.makeMeasureSpec( widthMeasureSpec = MeasureSpec.makeMeasureSpec(
Math.min(w, widthSize), EXACTLY); Math.min(w, widthSize), EXACTLY);
fixedWidth = true; fixedWidth = true;
} else { } else {
widthMeasureSpec = MeasureSpec.makeMeasureSpec( widthMeasureSpec = MeasureSpec.makeMeasureSpec(
widthMeasureSpec - mFloatingInsets.left - mFloatingInsets.right, widthSize - mFloatingInsets.left - mFloatingInsets.right,
AT_MOST); AT_MOST);
mApplyFloatingHorizontalInsets = true; mApplyFloatingHorizontalInsets = true;
} }