am 6067d953: Merge change 5428 into donut
Merge commit '6067d953d7c6c0216a383fe520222fa6a23926fa' * commit '6067d953d7c6c0216a383fe520222fa6a23926fa': Improve handling of FILL_PARENT in RelativeLayout.
This commit is contained in:
committed by
The Android Open Source Project
commit
a2071618a0
@@ -358,7 +358,7 @@ public class RelativeLayout extends ViewGroup {
|
||||
LayoutParams params = (LayoutParams) child.getLayoutParams();
|
||||
|
||||
applyHorizontalSizeRules(params, myWidth);
|
||||
measureChildHorizontal(child, params, myWidth);
|
||||
measureChildHorizontal(child, params, myWidth, myHeight);
|
||||
if (positionChildHorizontal(child, params, myWidth, isWrapContentWidth)) {
|
||||
offsetHorizontalAxis = true;
|
||||
}
|
||||
@@ -550,13 +550,18 @@ public class RelativeLayout extends ViewGroup {
|
||||
child.measure(childWidthMeasureSpec, childHeightMeasureSpec);
|
||||
}
|
||||
|
||||
private void measureChildHorizontal(View child, LayoutParams params, int myWidth) {
|
||||
private void measureChildHorizontal(View child, LayoutParams params, int myWidth, int myHeight) {
|
||||
int childWidthMeasureSpec = getChildMeasureSpec(params.mLeft,
|
||||
params.mRight, params.width,
|
||||
params.leftMargin, params.rightMargin,
|
||||
mPaddingLeft, mPaddingRight,
|
||||
myWidth);
|
||||
int childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);
|
||||
int childHeightMeasureSpec;
|
||||
if (params.width == LayoutParams.FILL_PARENT) {
|
||||
childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(MeasureSpec.EXACTLY, myHeight);
|
||||
} else {
|
||||
childHeightMeasureSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);
|
||||
}
|
||||
child.measure(childWidthMeasureSpec, childHeightMeasureSpec);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user