From eabc9198447c7f6253fcbee8af2887a650e79b00 Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Fri, 4 May 2012 14:49:46 -0700 Subject: Fix LinearLayout measureWithLargestChild for wrap_content views Bug 6442795 When the measureWithLargestChild setting is enabled, LL used to measure the full container taking the largest child rule into account, but the child views were not properly remeasured for AT_MOST measurespecs. Correct this. Fix measureWithLargestChild for height Change-Id: Ieb91114bc2ae65f9104337bd6d16a7d9e559571d --- core/java/android/widget/LinearLayout.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/java/android/widget/LinearLayout.java') diff --git a/core/java/android/widget/LinearLayout.java b/core/java/android/widget/LinearLayout.java index 5ed005f..2391898 100644 --- a/core/java/android/widget/LinearLayout.java +++ b/core/java/android/widget/LinearLayout.java @@ -867,7 +867,7 @@ public class LinearLayout extends ViewGroup { // We have no limit, so make all weighted views as tall as the largest child. // Children will have already been measured once. - if (useLargestChild && widthMode == MeasureSpec.UNSPECIFIED) { + if (useLargestChild && heightMode != MeasureSpec.EXACTLY) { for (int i = 0; i < count; i++) { final View child = getVirtualChildAt(i); @@ -1283,7 +1283,7 @@ public class LinearLayout extends ViewGroup { // We have no limit, so make all weighted views as wide as the largest child. // Children will have already been measured once. - if (useLargestChild && widthMode == MeasureSpec.UNSPECIFIED) { + if (useLargestChild && widthMode != MeasureSpec.EXACTLY) { for (int i = 0; i < count; i++) { final View child = getVirtualChildAt(i); -- cgit v1.1