float childMarginHeight = childMargin.Top + childMargin.Bottom;
bool useRemainingWidth = (childDesiredWidth == 0) && (childWeight > 0);
- totalWeight += childWeight;
-
if ((childDesiredWidth == LayoutParamPolicies.MatchParent) || (useRemainingWidth))
{
+ totalWeight += childWeight;
childrenMatchParentCount++;
}
if (needToMeasure == true)
{
MeasureChildWithMargins(childLayout, widthMeasureSpec, new LayoutLength(0), heightMeasureSpec, new LayoutLength(0));
+ }
- if (childWeight > 0)
- {
- float childMeasuredWidth = childLayout.MeasuredWidth.Size.AsDecimal();
+ if ((childWeight > 0) && ((childDesiredWidth == LayoutParamPolicies.MatchParent) || (childDesiredWidth == 0)))
+ {
+ float childMeasuredWidth = childLayout.MeasuredWidth.Size.AsDecimal();
- if (childMeasuredWidth < 0)
- {
- totalWeightLength = Math.Max(totalWeightLength, totalWeightLength + childMargin.Start + childMargin.End);
- }
- else
- {
- totalWeightLength = Math.Max(totalWeightLength, totalWeightLength + childMeasuredWidth + childMargin.Start + childMargin.End);
- }
+ if (childMeasuredWidth < 0)
+ {
+ totalWeightLength = Math.Max(totalWeightLength, totalWeightLength + childMargin.Start + childMargin.End);
+ }
+ else
+ {
+ totalWeightLength = Math.Max(totalWeightLength, totalWeightLength + childMeasuredWidth + childMargin.Start + childMargin.End);
}
}
} // 2ND PHASE foreach
float childMarginHeight = childMargin.Top + childMargin.Bottom;
bool useRemainingHeight = (childDesiredHeight == 0) && (childWeight > 0);
- totalWeight += childWeight;
-
if ((childDesiredHeight == LayoutParamPolicies.MatchParent) || (useRemainingHeight))
{
+ totalWeight += childWeight;
childrenMatchParentCount++;
}
MeasureChildWithMargins(childLayout, widthMeasureSpec, new LayoutLength(0), heightMeasureSpec, new LayoutLength(0));
}
- if (childWeight > 0)
+ if ((childWeight > 0) && ((childDesiredHeight == LayoutParamPolicies.MatchParent) || (childDesiredHeight == 0)))
{
float childMeasuredHeight = childLayout.MeasuredHeight.Size.AsDecimal();