Merge "Fix RelativeLayout measurement"

This commit is contained in:
Alan Viverette
2014-02-12 23:51:11 +00:00
committed by Android (Google) Code Review

View File

@@ -748,14 +748,14 @@ public class RelativeLayout extends ViewGroup {
// measurement is code for, "we got an unspecified mode in the
// RelativeLayout's measure spec."
if (mySize < 0 && !mAllowBrokenMeasureSpecs) {
if (childSize >= 0) {
// The child specified an exact size.
childSpecSize = childSize;
childSpecMode = MeasureSpec.EXACTLY;
} else if (childStart >= 0 && childEnd >= 0) {
if (childStart >= 0 && childEnd >= 0) {
// Constraints fixed both edges, so child has an exact size.
childSpecSize = Math.max(0, childEnd - childStart);
childSpecMode = MeasureSpec.EXACTLY;
} else if (childSize >= 0) {
// The child specified an exact size.
childSpecSize = childSize;
childSpecMode = MeasureSpec.EXACTLY;
} else {
// Allow the child to be whatever size it wants.
childSpecSize = 0;