Merge "Don't match wrap_content/match_parent children with child count = 1. Bug #3328711" into honeycomb

This commit is contained in:
Romain Guy
2011-01-07 13:24:50 -08:00
committed by Android (Google) Code Review
3 changed files with 7 additions and 3 deletions

View File

@@ -297,15 +297,15 @@ public class FrameLayout extends ViewGroup {
resolveSizeAndState(maxHeight, heightMeasureSpec, resolveSizeAndState(maxHeight, heightMeasureSpec,
childState << MEASURED_HEIGHT_STATE_SHIFT)); childState << MEASURED_HEIGHT_STATE_SHIFT));
if (mMatchParentChildren.size() > 0) { count = mMatchParentChildren.size();
count = mMatchParentChildren.size(); if (count > 1) {
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
final View child = mMatchParentChildren.get(i); final View child = mMatchParentChildren.get(i);
final MarginLayoutParams lp = (MarginLayoutParams) child.getLayoutParams(); final MarginLayoutParams lp = (MarginLayoutParams) child.getLayoutParams();
int childWidthMeasureSpec; int childWidthMeasureSpec;
int childHeightMeasureSpec; int childHeightMeasureSpec;
if (lp.width == LayoutParams.MATCH_PARENT) { if (lp.width == LayoutParams.MATCH_PARENT) {
childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(getMeasuredWidth() - childWidthMeasureSpec = MeasureSpec.makeMeasureSpec(getMeasuredWidth() -
mPaddingLeft - mPaddingRight - lp.leftMargin - lp.rightMargin, mPaddingLeft - mPaddingRight - lp.leftMargin - lp.rightMargin,

View File

@@ -16,6 +16,7 @@
package android.widget; package android.widget;
import android.view.ViewDebug;
import com.android.internal.R; import com.android.internal.R;
import android.util.AttributeSet; import android.util.AttributeSet;
@@ -115,6 +116,7 @@ public class HorizontalScrollView extends FrameLayout {
* When set to true, the scroll view measure its child to make it fill the currently * When set to true, the scroll view measure its child to make it fill the currently
* visible area. * visible area.
*/ */
@ViewDebug.ExportedProperty(category = "layout")
private boolean mFillViewport; private boolean mFillViewport;
/** /**

View File

@@ -16,6 +16,7 @@
package android.widget; package android.widget;
import android.view.ViewDebug;
import com.android.internal.R; import com.android.internal.R;
import android.content.Context; import android.content.Context;
@@ -110,6 +111,7 @@ public class ScrollView extends FrameLayout {
* When set to true, the scroll view measure its child to make it fill the currently * When set to true, the scroll view measure its child to make it fill the currently
* visible area. * visible area.
*/ */
@ViewDebug.ExportedProperty(category = "layout")
private boolean mFillViewport; private boolean mFillViewport;
/** /**