{
MeasureSpecification.ModeType specMode = parentMeasureSpec.Mode;
MeasureSpecification.ModeType resultMode = MeasureSpecification.ModeType.Unspecified;
- LayoutLength resultSize = new LayoutLength(Math.Max( 0.0f, (parentMeasureSpec.Size.AsDecimal() - padding.AsDecimal() ) )); // reduce available size by the owners padding
+ // Child only can use parent's size without parent's padding and own margin.
+ LayoutLength resultSize = new LayoutLength(Math.Max( 0.0f, parentMeasureSpec.Size.AsDecimal()));
switch( specMode )
{
// Parent has imposed an exact size on us
case MeasureSpecification.ModeType.Exactly:
{
- if ((int)childDimension.AsRoundedValue() == LayoutParamPolicies.MatchParent)
- {
- // Child wants to be our size. So be it.
- resultMode = MeasureSpecification.ModeType.Exactly;
- }
- else if ((int)childDimension.AsRoundedValue() == LayoutParamPolicies.WrapContent)
- {
- // Child wants to determine its own size. It can't be
- // bigger than us.
- resultMode = MeasureSpecification.ModeType.AtMost;
- }
- else
- {
- resultSize = childDimension;
- resultMode = MeasureSpecification.ModeType.Exactly;
- }
+ if ((int)childDimension.AsRoundedValue() == LayoutParamPolicies.MatchParent)
+ {
+ // Child wants to be our size. So be it.
+ resultMode = MeasureSpecification.ModeType.Exactly;
+ }
+ else if ((int)childDimension.AsRoundedValue() == LayoutParamPolicies.WrapContent)
+ {
+ // Child wants to determine its own size. It can't be
+ // bigger than us.
+ // Don't need parent's size. Size of this child will be determined by its children.
+ resultMode = MeasureSpecification.ModeType.AtMost;
+ }
+ else
+ {
+ // Child has its own size.
+ resultSize = childDimension;
+ resultMode = MeasureSpecification.ModeType.Exactly;
+ }
- break;
+ break;
}
// Parent has imposed a maximum size on us
case MeasureSpecification.ModeType.AtMost:
{
- if (childDimension.AsRoundedValue() == LayoutParamPolicies.MatchParent)
- {
- // Child wants to be our size, but our size is not fixed.
- // Constrain child to not be bigger than us.
- resultMode = MeasureSpecification.ModeType.AtMost;
- }
- else if (childDimension.AsRoundedValue() == LayoutParamPolicies.WrapContent)
- {
- // Child wants to determine its own size. It can't be
- // bigger than us.
- resultMode = MeasureSpecification.ModeType.AtMost;
- }
- else
- {
- // Child wants a specific size... so be it
- resultSize = childDimension + padding;
- resultMode = MeasureSpecification.ModeType.Exactly;
- }
+ if (childDimension.AsRoundedValue() == LayoutParamPolicies.MatchParent)
+ {
+ // Crashed. Cannot calculate.
+
+ // Child wants to be our size, but our size is not fixed.
+ // Constrain child to not be bigger than us.
+ resultMode = MeasureSpecification.ModeType.AtMost;
+ }
+ else if (childDimension.AsRoundedValue() == LayoutParamPolicies.WrapContent)
+ {
+ // Child wants to determine its own size. It can't be
+ // bigger than us.
- break;
+ // Don't need parent's size. Size of this child will be determined by its children.
+ resultMode = MeasureSpecification.ModeType.AtMost;
+ }
+ else
+ {
+ // Child wants a specific size... so be it
+ resultSize = childDimension;
+ resultMode = MeasureSpecification.ModeType.Exactly;
+ }
+
+ break;
}
// Parent asked to see how big we want to be
case MeasureSpecification.ModeType.Unspecified:
{
+ if ((childDimension.AsRoundedValue() == LayoutParamPolicies.MatchParent))
+ {
+ // Child wants to be our size... find out how big it should be
- if ((childDimension.AsRoundedValue() == LayoutParamPolicies.MatchParent))
- {
- // Child wants to be our size... find out how big it should be
- resultMode = MeasureSpecification.ModeType.Unspecified;
- }
- else if (childDimension.AsRoundedValue() == (LayoutParamPolicies.WrapContent))
- {
- // Child wants to determine its own size.... find out how big
- // it should be
- resultMode = MeasureSpecification.ModeType.Unspecified;
- }
- else
- {
- // Child wants a specific size... let him have it
- resultSize = childDimension + padding;
- resultMode = MeasureSpecification.ModeType.Exactly;
- }
- break;
+ // There is no one who has exact size in parent hierarchy.
+ // Cannot calculate.
+ resultMode = MeasureSpecification.ModeType.Unspecified;
+ }
+ else if (childDimension.AsRoundedValue() == (LayoutParamPolicies.WrapContent))
+ {
+ // Child wants to determine its own size.... find out how big
+ // it should be
+ resultMode = MeasureSpecification.ModeType.Unspecified;
+ }
+ else
+ {
+ // Child wants a specific size... let him have it
+ resultSize = childDimension;
+ resultMode = MeasureSpecification.ModeType.Exactly;
+ }
+ break;
}
} // switch
{
View childOwner = child.Owner;
- Extents padding = childOwner.Padding; // Padding of this layout's owner, not of the child being measured.
-
- MeasureSpecification childWidthMeasureSpec = GetChildMeasureSpecification( parentWidthMeasureSpec,
- new LayoutLength(padding.Start + padding.End ),
- new LayoutLength(childOwner.WidthSpecification) );
+ MeasureSpecification childWidthMeasureSpec = GetChildMeasureSpecification(
+ new MeasureSpecification(
+ new LayoutLength(parentWidthMeasureSpec.Size - (Padding.Start + Padding.End + childOwner.Margin.Start + childOwner.Margin.End)),
+ parentWidthMeasureSpec.Mode),
+ new LayoutLength(Padding.Start + Padding.End ),
+ new LayoutLength(childOwner.WidthSpecification) );
- MeasureSpecification childHeightMeasureSpec = GetChildMeasureSpecification( parentHeightMeasureSpec,
- new LayoutLength(padding.Top + padding.Bottom),
- new LayoutLength(childOwner.HeightSpecification) );
+ MeasureSpecification childHeightMeasureSpec = GetChildMeasureSpecification(
+ new MeasureSpecification(
+ new LayoutLength(parentHeightMeasureSpec.Size - (Padding.Top + Padding.Bottom + childOwner.Margin.Top + childOwner.Margin.Bottom)),
+ parentHeightMeasureSpec.Mode),
+ new LayoutLength(Padding.Top + Padding.Bottom),
+ new LayoutLength(childOwner.HeightSpecification));
child.Measure( childWidthMeasureSpec, childHeightMeasureSpec );
}
protected virtual void MeasureChildWithMargins(LayoutItem child, MeasureSpecification parentWidthMeasureSpec, LayoutLength widthUsed, MeasureSpecification parentHeightMeasureSpec, LayoutLength heightUsed)
{
View childOwner = child.Owner;
- int desiredWidth = childOwner.WidthSpecification;
- int desiredHeight = childOwner.HeightSpecification;
- Extents padding = child.Padding; // Padding of this layout's owner, not of the child being measured.
- MeasureSpecification childWidthMeasureSpec = GetChildMeasureSpecification( parentWidthMeasureSpec,
- new LayoutLength( padding.Start + padding.End ) +
- widthUsed, new LayoutLength(desiredWidth) );
-
-
- MeasureSpecification childHeightMeasureSpec = GetChildMeasureSpecification( parentHeightMeasureSpec,
- new LayoutLength( padding.Top + padding.Bottom )+
- heightUsed, new LayoutLength(desiredHeight) );
+ MeasureSpecification childWidthMeasureSpec = GetChildMeasureSpecification(
+ new MeasureSpecification(
+ new LayoutLength(parentWidthMeasureSpec.Size + widthUsed - (Padding.Start + Padding.End + childOwner.Margin.Start + childOwner.Margin.End)),
+ parentWidthMeasureSpec.Mode),
+ new LayoutLength(Padding.Start + Padding.End ),
+ new LayoutLength(childOwner.WidthSpecification) );
+ MeasureSpecification childHeightMeasureSpec = GetChildMeasureSpecification(
+ new MeasureSpecification(
+ new LayoutLength(parentHeightMeasureSpec.Size + heightUsed - (Padding.Top + Padding.Bottom + childOwner.Margin.Top + childOwner.Margin.Bottom)),
+ parentHeightMeasureSpec.Mode),
+ new LayoutLength(Padding.Top + Padding.Bottom),
+ new LayoutLength(childOwner.HeightSpecification));
child.Measure( childWidthMeasureSpec, childHeightMeasureSpec );
+
}
}
}
\ No newline at end of file
float desiredHeight = childLayout.Owner.HeightSpecification;
float childLength = 0;
- Extents layoutPadding = Padding;
-
// Always lay out weighted elements with intrinsic size regardless of the parent spec.
// for consistency between specs.
if( ( horizontal && ( desiredWidth == 0 )) || ( !horizontal && ( desiredHeight == 0 )) )
if (horizontal)
{
childWidthMeasureSpec = new MeasureSpecification( new LayoutLength(childLength), MeasureSpecification.ModeType.Exactly );
- childHeightMeasureSpec = GetChildMeasureSpecification( heightMeasureSpec,
- new LayoutLength(layoutPadding.Top + layoutPadding.Bottom),
- new LayoutLength(desiredHeight) );
+ childHeightMeasureSpec = GetChildMeasureSpecification(
+ new MeasureSpecification(
+ new LayoutLength(heightMeasureSpec.Size - (Padding.Top + Padding.Bottom + childLayout.Owner.Margin.Top + childLayout.Owner.Margin.Bottom)),
+ heightMeasureSpec.Mode),
+ new LayoutLength(Padding.Top + Padding.Bottom),
+ new LayoutLength(desiredHeight));
}
else // vertical
{
- childWidthMeasureSpec = GetChildMeasureSpecification( widthMeasureSpec,
+ childWidthMeasureSpec = GetChildMeasureSpecification(
+ new MeasureSpecification(
+ new LayoutLength(widthMeasureSpec.Size - (Padding.Start + Padding.End + childLayout.Owner.Margin.Start + childLayout.Owner.Margin.End)),
+ widthMeasureSpec.Mode),
new LayoutLength(Padding.Start + Padding.End),
- new LayoutLength(desiredWidth) );
+ new LayoutLength(desiredWidth));
childHeightMeasureSpec = new MeasureSpecification( new LayoutLength(childLength), MeasureSpecification.ModeType.Exactly);
}
if( isExactly && useExcessSpace )
{
// Children to be laid out with excess space can be measured later
- _totalLength += childMargin.Start + childMargin.End;
+ _totalLength = Math.Max( _totalLength, (_totalLength + childMargin.Start + childMargin.End) );
}
else
{
if (useExcessSpace)
{
+ // Parent is not defiend!!!
// The widthMode is either Unspecified or AtMost, and
// this child is only laid out using excess space. Measure
// using WrapContent so that we can find out the view's
// optimal width.
- MeasureSpecification childWidthMeasureSpec = GetChildMeasureSpecification(widthMeasureSpec,
- new LayoutLength(childLayout.Padding.Start + childLayout.Padding.End),
+ MeasureSpecification childWidthMeasureSpec = GetChildMeasureSpecification(
+ new MeasureSpecification(
+ new LayoutLength(widthMeasureSpec.Size - (Padding.Start + Padding.End + childLayout.Margin.Start + childLayout.Margin.End)),
+ widthMeasureSpec.Mode),
+ new LayoutLength(Padding.Start + Padding.End),
new LayoutLength(LayoutParamPolicies.WrapContent));
- MeasureSpecification childHeightMeasureSpec = GetChildMeasureSpecification(heightMeasureSpec,
- new LayoutLength(childLayout.Padding.Top + childLayout.Padding.Bottom),
+ MeasureSpecification childHeightMeasureSpec = GetChildMeasureSpecification(
+ new MeasureSpecification(
+ new LayoutLength(heightMeasureSpec.Size - (Padding.Top + Padding.Bottom + childLayout.Margin.Top + childLayout.Margin.Bottom)),
+ heightMeasureSpec.Mode),
+ new LayoutLength(Padding.Top + Padding.Bottom),
new LayoutLength(childDesiredHeight));
childLayout.Measure( childWidthMeasureSpec, childHeightMeasureSpec);
}
} // foreach
- Extents padding = Padding;
- _totalLength += padding.Start + padding.End;
-
float widthSize = _totalLength;
widthSize = Math.Max( widthSize, SuggestedMinimumWidth.AsDecimal());
- MeasuredSize widthSizeAndState = ResolveSizeAndState( new LayoutLength(widthSize), widthMeasureSpec, MeasuredSize.StateType.MeasuredSizeOK);
+ MeasuredSize widthSizeAndState = ResolveSizeAndState( new LayoutLength(widthSize + Padding.Start + Padding.End), widthMeasureSpec, MeasuredSize.StateType.MeasuredSizeOK);
widthSize = widthSizeAndState.Size.AsDecimal();
// 2nd phase:
// We cycle through weighted children now (children with weight > 0).
// The children are measured with exact size equal to their share of the available space based on their weights.
// _totalLength is updated to include weighted children measured sizes.
- float remainingExcess = widthSize - _totalLength + usedExcessSpace;
+ float remainingExcess = widthSize - _totalLength + usedExcessSpace - (Padding.Start + Padding.End);
if( remainingExcess != 0 && totalWeight > 0 )
{
float remainingWeight = totalWeight;
maxHeight = Math.Max( maxHeight, childHeight );
alternativeMaxHeight = Math.Max( alternativeMaxHeight, matchHeightLocally ? marginHeight : childHeight );
allFillParent = (allFillParent && desiredChildHeight == LayoutParamPolicies.MatchParent);
-
- _totalLength += padding.Start + padding.End;
} // for loop
}
else
maxHeight = alternativeMaxHeight;
}
- maxHeight += padding.Top + padding.Bottom;
+
+
+ // Padding should be concerned when specification is Wrapcontent.
+ maxHeight += (Owner.HeightSpecification == LayoutParamPolicies.WrapContent)?(Padding.Top + Padding.Bottom):0;
maxHeight = Math.Max( maxHeight, SuggestedMinimumHeight.AsRoundedValue() );
widthSizeAndState.State = childState.widthState;
SetMeasuredDimensions(widthSizeAndState,
- ResolveSizeAndState( new LayoutLength(maxHeight), heightMeasureSpec, childState.heightState ));
+ ResolveSizeAndState( new LayoutLength(maxHeight + Padding.Top + Padding.Bottom), heightMeasureSpec, childState.heightState ));
if (matchHeight)
{
// Reset total length
_totalLength = 0.0f;
float usedExcessSpace =0.0f;
-
HeightAndWidthState childState = new HeightAndWidthState(MeasuredSize.StateType.MeasuredSizeOK,
- MeasuredSize.StateType.MeasuredSizeTooSmall);
+ MeasuredSize.StateType.MeasuredSizeOK);
// measure children, and determine if further resolution is required
// to accumulate total used space in _totalLength.
// Weighted children are not measured in this phase.
// Available space for weighted children will be calculated in the phase 2 based on _totalLength value.
- uint index = 0;
foreach( LayoutItem childLayout in LayoutChildren )
{
int childDesiredWidth = childLayout.Owner.WidthSpecification;
- int childDesiredHeight = childLayout.Owner.HeightSpecification;
float childWeight = childLayout.Owner.Weight;
Extents childMargin = childLayout.Margin;
totalWeight += childWeight;
- bool useExcessSpace = (childDesiredHeight == 0) && (childWeight > 0);
-
+ bool useExcessSpace = (childLayout.Owner.HeightSpecification == 0) && (childWeight > 0);
if( isExactly && useExcessSpace )
{
_totalLength = Math.Max( _totalLength, (_totalLength + childMargin.Top + childMargin.Bottom) );
}
else
{
- float childHeight = 0.0f;
if( useExcessSpace )
{
// The heightMode is either Unspecified or AtMost, and
// using WrapContent so that we can find out the view's
// optimal height.
// We'll restore the original height of 0 after measurement.
- MeasureSpecification childWidthMeasureSpec = GetChildMeasureSpecification( widthMeasureSpec,
- new LayoutLength(childLayout.Padding.Start + childLayout.Padding.End),
- new LayoutLength(childDesiredWidth) );
- MeasureSpecification childHeightMeasureSpec = GetChildMeasureSpecification( heightMeasureSpec,
- new LayoutLength(childLayout.Padding.Top + childLayout.Padding.Bottom),
- new LayoutLength(LayoutParamPolicies.WrapContent) );
- childLayout.Measure( childWidthMeasureSpec, childHeightMeasureSpec );
- childHeight = childLayout.MeasuredHeight.Size.AsDecimal();
- usedExcessSpace += childHeight;
+ MeasureSpecification childWidthMeasureSpec = GetChildMeasureSpecification(
+ new MeasureSpecification(
+ new LayoutLength(widthMeasureSpec.Size - (Padding.Start + Padding.End + childLayout.Margin.Start + childLayout.Margin.End)),
+ widthMeasureSpec.Mode),
+ new LayoutLength(Padding.Start + Padding.End),
+ new LayoutLength(childDesiredWidth));
+
+ MeasureSpecification childHeightMeasureSpec = GetChildMeasureSpecification(
+ new MeasureSpecification(
+ new LayoutLength(heightMeasureSpec.Size - (Padding.Top + Padding.Bottom + childLayout.Margin.Top + childLayout.Margin.Bottom)),
+ heightMeasureSpec.Mode),
+ new LayoutLength(Padding.Top + Padding.Bottom),
+ new LayoutLength(LayoutParamPolicies.WrapContent));
+
+ childLayout.Measure(childWidthMeasureSpec, childHeightMeasureSpec);
+ usedExcessSpace += childLayout.MeasuredHeight.Size.AsDecimal();
}
else
{
MeasureChild( childLayout, widthMeasureSpec, heightMeasureSpec );
- childHeight = childLayout.MeasuredHeight.Size.AsDecimal();
}
- float length = childHeight + childMargin.Top + childMargin.Bottom;
- float cellPadding = CellPadding.Height;
- // No need to add cell padding to the end of last item.
- if (index>=LayoutChildren.Count-1)
+ LayoutLength childHeight = childLayout.MeasuredHeight.Size;
+ LayoutLength length = childHeight + childMargin.Top + childMargin.Bottom;
+
+
+ if (isExactly)
+ {
+ _totalLength += length.AsDecimal();
+ }
+ else
{
- cellPadding = 0.0f;
+ _totalLength = Math.Max(_totalLength, _totalLength + length.AsDecimal() + CellPadding.Height);
}
- _totalLength = Math.Max( _totalLength, _totalLength + length + cellPadding );
}
bool matchWidthLocally = false;
- if( widthMode != MeasureSpecification.ModeType.Exactly && (childDesiredWidth == LayoutParamPolicies.MatchParent) )
+ if( widthMode != MeasureSpecification.ModeType.Exactly && childDesiredWidth == LayoutParamPolicies.MatchParent)
{
// Will have to re-measure at least this child when we know exact height.
matchWidth = true;
matchWidthLocally = true;
}
- float marginWidth = (childLayout.Margin.Start) + (childLayout.Margin.End);
+ float marginWidth = childLayout.Margin.Start + childLayout.Margin.End;
float childWidth = childLayout.MeasuredWidth.Size.AsDecimal() + marginWidth;
if (childLayout.MeasuredWidth.State == MeasuredSize.StateType.MeasuredSizeTooSmall)
}
maxWidth = Math.Max( maxWidth, childWidth);
- allFillParent = (allFillParent && (childDesiredWidth == LayoutParamPolicies.MatchParent));
-
- float widthforWeight = childWidth;
- if (matchWidthLocally)
- {
- widthforWeight = marginWidth;
- }
+ allFillParent = ( allFillParent && childDesiredWidth == LayoutParamPolicies.MatchParent);
if (childWeight > 0)
{
// Widths of weighted Views are bogus if we end up remeasuring, so keep them separate.
- weightedMaxWidth = Math.Max( weightedMaxWidth, widthforWeight);
+ weightedMaxWidth = Math.Max( weightedMaxWidth, matchWidthLocally ? marginWidth : childWidth);
}
else
{
- alternativeMaxWidth = Math.Max( alternativeMaxWidth, widthforWeight);
+ alternativeMaxWidth = Math.Max( alternativeMaxWidth, matchWidthLocally ? marginWidth : childWidth);
}
- index++;
} // foreach
- Extents padding = Padding;
- _totalLength += padding.Top + padding.Bottom;
- LayoutLength heightSize = new LayoutLength(_totalLength);
- heightSize = new LayoutLength(Math.Max( heightSize.AsDecimal(), SuggestedMinimumHeight.AsDecimal() ));
- MeasuredSize heightSizeAndState = ResolveSizeAndState( heightSize, heightMeasureSpec, MeasuredSize.StateType.MeasuredSizeOK);
- heightSize = heightSizeAndState.Size;
+ float heightSize = _totalLength;
+ heightSize = Math.Max( heightSize, SuggestedMinimumHeight.AsDecimal());
+ MeasuredSize heightSizeAndState = ResolveSizeAndState( new LayoutLength(heightSize + Padding.Top + Padding.Bottom), heightMeasureSpec, MeasuredSize.StateType.MeasuredSizeOK );
+ heightSize = heightSizeAndState.Size.AsDecimal();
// 2nd phase:
// We cycle through weighted children now (children with weight > 0).
// The children are measured with exact size equal to their share of the available space based on their weights.
// _totalLength is updated to include weighted children measured sizes.
- float remainingExcess = heightSize.AsDecimal() - _totalLength + usedExcessSpace;
-
+ float remainingExcess = heightSize - _totalLength + usedExcessSpace - (Padding.Top + Padding.Bottom);
if( remainingExcess != 0 && totalWeight > 0.0f )
{
float remainingWeight = totalWeight;
-
+ maxWidth = 0;
_totalLength = 0;
int numberOfChildren = LayoutChildren.Count;
if( childWeight > 0 )
{
- MeasureWeightedChild(childLayout, remainingExcess, remainingWeight, childWeight,
- widthMeasureSpec, heightMeasureSpec, childState,
- Orientation.Vertical);
+ MeasureWeightedChild(childLayout, remainingExcess, remainingWeight, childWeight,
+ widthMeasureSpec, heightMeasureSpec, childState,
+ Orientation.Vertical);
}
- bool matchWidthLocally = false;
- if( widthMode != MeasureSpecification.ModeType.Exactly && desiredChildWidth == LayoutParamPolicies.MatchParent)
+ float length = childLayout.MeasuredHeight.Size.AsDecimal() + childMargin.Top + childMargin.Bottom;
+ float cellPadding = i < numberOfChildren - 1 ? CellPadding.Height : 0;
+
+ if( isExactly )
+ {
+ _totalLength += length;
+ }
+ else
{
- // Will have to re-measure at least this child when we know exact height.
- matchWidth = true;
- matchWidthLocally = true;
+ float totalLength = _totalLength;
+ _totalLength = Math.Max( _totalLength, _totalLength + length + cellPadding );
}
+ bool matchWidthLocally = (widthMode != MeasureSpecification.ModeType.Exactly) && (desiredChildWidth == LayoutParamPolicies.MatchParent);
float marginWidth = childMargin.Start + childMargin.End;
float childWidth = childLayout.MeasuredWidth.Size.AsDecimal() + marginWidth;
- maxWidth = Math.Max( maxWidth, childWidth );
- allFillParent = allFillParent && desiredChildWidth == LayoutParamPolicies.MatchParent;
- float childHeight = childLayout.MeasuredHeight.Size.AsDecimal();
- float childLength = childHeight + childMargin.Top + childMargin.Bottom;
- float cellPadding = i < numberOfChildren - 1 ? CellPadding.Height : 0.0f;
- _totalLength = _totalLength + childLength + cellPadding;
+ maxWidth = Math.Max( maxWidth, childWidth );
alternativeMaxWidth = Math.Max( alternativeMaxWidth, matchWidthLocally ? marginWidth : childWidth );
+ allFillParent = (allFillParent && desiredChildWidth == LayoutParamPolicies.MatchParent);
} // for loop
-
- // Add in our padding
- _totalLength += padding.Top + padding.Bottom;
}
else
{
{
maxWidth = alternativeMaxWidth;
}
- maxWidth += padding.Start + padding.End;
+
+ maxWidth += (Owner.WidthSpecification == LayoutParamPolicies.WrapContent)?(Padding.Start + Padding.End):0;
maxWidth = Math.Max( maxWidth, SuggestedMinimumWidth.AsRoundedValue());
heightSizeAndState.State = childState.heightState;
- SetMeasuredDimensions( ResolveSizeAndState( new LayoutLength(maxWidth), widthMeasureSpec, childState.widthState ),
+ SetMeasuredDimensions( ResolveSizeAndState( new LayoutLength(maxWidth + Padding.Top + Padding.Bottom), widthMeasureSpec, childState.widthState ),
heightSizeAndState );
if (matchWidth)