Loading core/java/android/widget/LinearLayout.java +11 −4 Original line number Diff line number Diff line Loading @@ -667,6 +667,7 @@ public class LinearLayout extends ViewGroup { final int heightMode = MeasureSpec.getMode(heightMeasureSpec); boolean matchWidth = false; boolean skippedMeasure = false; final int baselineChildIndex = mBaselineAlignedChildIndex; final boolean useLargestChild = mUseLargestChild; Loading Loading @@ -701,6 +702,7 @@ public class LinearLayout extends ViewGroup { // there is any leftover space. final int totalLength = mTotalLength; mTotalLength = Math.max(totalLength, totalLength + lp.topMargin + lp.bottomMargin); skippedMeasure = true; } else { int oldHeight = Integer.MIN_VALUE; Loading Loading @@ -827,9 +829,10 @@ public class LinearLayout extends ViewGroup { heightSize = heightSizeAndState & MEASURED_SIZE_MASK; // Either expand children with weight to take up available space or // shrink them if they extend beyond our current bounds // shrink them if they extend beyond our current bounds. If we skipped // measurement on any children, we need to measure them now. int delta = heightSize - mTotalLength; if (delta != 0 && totalWeight > 0.0f) { if (skippedMeasure || delta != 0 && totalWeight > 0.0f) { float weightSum = mWeightSum > 0.0f ? mWeightSum : totalWeight; mTotalLength = 0; Loading Loading @@ -995,6 +998,7 @@ public class LinearLayout extends ViewGroup { final int heightMode = MeasureSpec.getMode(heightMeasureSpec); boolean matchHeight = false; boolean skippedMeasure = false; if (mMaxAscent == null || mMaxDescent == null) { mMaxAscent = new int[VERTICAL_GRAVITY_COUNT]; Loading Loading @@ -1057,6 +1061,8 @@ public class LinearLayout extends ViewGroup { if (baselineAligned) { final int freeSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED); child.measure(freeSpec, freeSpec); } else { skippedMeasure = true; } } else { int oldWidth = Integer.MIN_VALUE; Loading Loading @@ -1205,9 +1211,10 @@ public class LinearLayout extends ViewGroup { widthSize = widthSizeAndState & MEASURED_SIZE_MASK; // Either expand children with weight to take up available space or // shrink them if they extend beyond our current bounds // shrink them if they extend beyond our current bounds. If we skipped // measurement on any children, we need to measure them now. int delta = widthSize - mTotalLength; if (delta != 0 && totalWeight > 0.0f) { if (skippedMeasure || delta != 0 && totalWeight > 0.0f) { float weightSum = mWeightSum > 0.0f ? mWeightSum : totalWeight; maxAscent[0] = maxAscent[1] = maxAscent[2] = maxAscent[3] = -1; Loading Loading
core/java/android/widget/LinearLayout.java +11 −4 Original line number Diff line number Diff line Loading @@ -667,6 +667,7 @@ public class LinearLayout extends ViewGroup { final int heightMode = MeasureSpec.getMode(heightMeasureSpec); boolean matchWidth = false; boolean skippedMeasure = false; final int baselineChildIndex = mBaselineAlignedChildIndex; final boolean useLargestChild = mUseLargestChild; Loading Loading @@ -701,6 +702,7 @@ public class LinearLayout extends ViewGroup { // there is any leftover space. final int totalLength = mTotalLength; mTotalLength = Math.max(totalLength, totalLength + lp.topMargin + lp.bottomMargin); skippedMeasure = true; } else { int oldHeight = Integer.MIN_VALUE; Loading Loading @@ -827,9 +829,10 @@ public class LinearLayout extends ViewGroup { heightSize = heightSizeAndState & MEASURED_SIZE_MASK; // Either expand children with weight to take up available space or // shrink them if they extend beyond our current bounds // shrink them if they extend beyond our current bounds. If we skipped // measurement on any children, we need to measure them now. int delta = heightSize - mTotalLength; if (delta != 0 && totalWeight > 0.0f) { if (skippedMeasure || delta != 0 && totalWeight > 0.0f) { float weightSum = mWeightSum > 0.0f ? mWeightSum : totalWeight; mTotalLength = 0; Loading Loading @@ -995,6 +998,7 @@ public class LinearLayout extends ViewGroup { final int heightMode = MeasureSpec.getMode(heightMeasureSpec); boolean matchHeight = false; boolean skippedMeasure = false; if (mMaxAscent == null || mMaxDescent == null) { mMaxAscent = new int[VERTICAL_GRAVITY_COUNT]; Loading Loading @@ -1057,6 +1061,8 @@ public class LinearLayout extends ViewGroup { if (baselineAligned) { final int freeSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED); child.measure(freeSpec, freeSpec); } else { skippedMeasure = true; } } else { int oldWidth = Integer.MIN_VALUE; Loading Loading @@ -1205,9 +1211,10 @@ public class LinearLayout extends ViewGroup { widthSize = widthSizeAndState & MEASURED_SIZE_MASK; // Either expand children with weight to take up available space or // shrink them if they extend beyond our current bounds // shrink them if they extend beyond our current bounds. If we skipped // measurement on any children, we need to measure them now. int delta = widthSize - mTotalLength; if (delta != 0 && totalWeight > 0.0f) { if (skippedMeasure || delta != 0 && totalWeight > 0.0f) { float weightSum = mWeightSum > 0.0f ? mWeightSum : totalWeight; maxAscent[0] = maxAscent[1] = maxAscent[2] = maxAscent[3] = -1; Loading