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

Commit 35b1674a authored by Alan Viverette's avatar Alan Viverette Committed by Android Git Automerger
Browse files

am 9b4917a6: am be01800d: am 9478bf0e: Merge "Fix handling of RelativeLayout...

am 9b4917a6: am be01800d: am 9478bf0e: Merge "Fix handling of RelativeLayout measurement using UNSPECIFIED spec" into mnc-dev

* commit '9b4917a6':
  Fix handling of RelativeLayout measurement using UNSPECIFIED spec
parents 5192e4b2 9b4917a6
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -731,7 +731,8 @@ public class RelativeLayout extends ViewGroup {
        // Negative values in a mySize value in RelativeLayout
        // measurement is code for, "we got an unspecified mode in the
        // RelativeLayout's measure spec."
        if (mySize < 0 && !mAllowBrokenMeasureSpecs) {
        final boolean isUnspecified = mySize < 0;
        if (isUnspecified && !mAllowBrokenMeasureSpecs) {
            if (childStart != VALUE_NOT_SET && childEnd != VALUE_NOT_SET) {
                // Constraints fixed both edges, so child has an exact size.
                childSpecSize = Math.max(0, childEnd - childStart);
@@ -767,7 +768,7 @@ public class RelativeLayout extends ViewGroup {

        if (childStart != VALUE_NOT_SET && childEnd != VALUE_NOT_SET) {
            // Constraints fixed both edges, so child must be an exact size.
            childSpecMode = MeasureSpec.EXACTLY;
            childSpecMode = isUnspecified ? MeasureSpec.UNSPECIFIED : MeasureSpec.EXACTLY;
            childSpecSize = Math.max(0, maxAvailable);
        } else {
            if (childSize >= 0) {
@@ -784,7 +785,7 @@ public class RelativeLayout extends ViewGroup {
            } else if (childSize == LayoutParams.MATCH_PARENT) {
                // Child wanted to be as big as possible. Give all available
                // space.
                childSpecMode = MeasureSpec.EXACTLY;
                childSpecMode = isUnspecified ? MeasureSpec.UNSPECIFIED : MeasureSpec.EXACTLY;
                childSpecSize = Math.max(0, maxAvailable);
            } else if (childSize == LayoutParams.WRAP_CONTENT) {
                // Child wants to wrap content. Use AT_MOST to communicate