diff options
| author | 2016-06-30 11:15:36 -0400 | |
|---|---|---|
| committer | 2016-06-30 11:15:36 -0400 | |
| commit | 070b22bdeebfc3b69b38fe30df0f026e628e847b (patch) | |
| tree | 930bd5b4b9a3ce471b9dc128b98933a1b912c98c | |
| parent | 43f6a45e7e111af8a843e001b555082cb356a529 (diff) | |
Exclude children from excess space distribution when using largest child
Preserves API 23 behavior.
Bug: 29872769
Change-Id: I514cde81dcca4d78238f407251805cced4c0bea1
| -rw-r--r-- | core/java/android/widget/LinearLayout.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/java/android/widget/LinearLayout.java b/core/java/android/widget/LinearLayout.java index f75b74bb9a14..38d7cd4acaf6 100644 --- a/core/java/android/widget/LinearLayout.java +++ b/core/java/android/widget/LinearLayout.java @@ -890,7 +890,9 @@ public class LinearLayout extends ViewGroup { remainingWeightSum -= childWeight; final int childHeight; - if (lp.height == 0 && (!mAllowInconsistentMeasurement + if (mUseLargestChild && heightMode != MeasureSpec.EXACTLY) { + childHeight = largestChildHeight; + } else if (lp.height == 0 && (!mAllowInconsistentMeasurement || heightMode == MeasureSpec.EXACTLY)) { // This child needs to be laid out from scratch using // only its share of excess space. @@ -1272,7 +1274,9 @@ public class LinearLayout extends ViewGroup { remainingWeightSum -= childWeight; final int childWidth; - if (lp.width == 0 && (!mAllowInconsistentMeasurement + if (mUseLargestChild && widthMode != MeasureSpec.EXACTLY) { + childWidth = largestChildWidth; + } else if (lp.width == 0 && (!mAllowInconsistentMeasurement || widthMode == MeasureSpec.EXACTLY)) { // This child needs to be laid out from scratch using // only its share of excess space. |