float alternativeMaxHeight = 0.0f;
float weightedMaxHeight = 0.0f;
float totalWeight = 0.0f;
+ int childrenCount = 0;
// Reset measure variables
_totalLength = 0.0f;
continue;
}
+ childrenCount++;
int childDesiredHeight = childLayout.Owner.HeightSpecification;
float childWeight = childLayout.Owner.Weight;
Extents childMargin = childLayout.Margin;
LayoutLength childWidth = childLayout.MeasuredWidth.Size;
LayoutLength length = childWidth + childMargin.Start + childMargin.End;
- if (isExactly)
- {
- _totalLength += length.AsDecimal();
- }
- else
- {
- _totalLength = Math.Max(_totalLength, _totalLength + length.AsDecimal() + (i < LayoutChildren.Count - 1 ? CellPadding.Width : 0));
- }
+ _totalLength = Math.Max(_totalLength, _totalLength + length.AsDecimal());
}
bool matchHeightLocally = false;
}
} // foreach
+ _totalLength = Math.Max(_totalLength, _totalLength + CellPadding.Width * (childrenCount - 1));
float widthSize = _totalLength;
widthSize = Math.Max(widthSize, SuggestedMinimumWidth.AsDecimal());
MeasuredSize widthSizeAndState = ResolveSizeAndState(new LayoutLength(widthSize + Padding.Start + Padding.End), widthMeasureSpec, MeasuredSize.StateType.MeasuredSizeOK);
}
float length = childLayout.MeasuredWidth.Size.AsDecimal() + childMargin.Start + childMargin.End;
- float cellPadding = i < numberOfChildren - 1 ? CellPadding.Width : 0;
- if (isExactly)
- {
- _totalLength += length;
- }
- else
- {
- float totalLength = _totalLength;
- _totalLength = Math.Max(_totalLength, _totalLength + length + cellPadding);
- }
+ _totalLength += length;
bool matchHeightLocally = (heightMode != MeasureSpecification.ModeType.Exactly) && (desiredChildHeight == LayoutParamPolicies.MatchParent);
float marginHeight = childMargin.Top + childMargin.Bottom;
alternativeMaxHeight = Math.Max(alternativeMaxHeight, matchHeightLocally ? marginHeight : childHeight);
allFillParent = (allFillParent && desiredChildHeight == LayoutParamPolicies.MatchParent);
} // for loop
+ _totalLength = Math.Max(_totalLength, _totalLength + CellPadding.Width * (childrenCount - 1));
}
else
{
float alternativeMaxWidth = 0.0f;
float weightedMaxWidth = 0.0f;
float totalWeight = 0.0f;
+ int childrenCount = 0;
// Reset total length
_totalLength = 0.0f;
continue;
}
+ childrenCount++;
int childDesiredWidth = childLayout.Owner.WidthSpecification;
float childWeight = childLayout.Owner.Weight;
Extents childMargin = childLayout.Margin;
LayoutLength childHeight = childLayout.MeasuredHeight.Size;
LayoutLength length = childHeight + childMargin.Top + childMargin.Bottom;
-
- if (isExactly)
- {
- _totalLength += length.AsDecimal();
- }
- else
- {
- _totalLength = Math.Max(_totalLength, _totalLength + length.AsDecimal() + (i < LayoutChildren.Count - 1 ? CellPadding.Height : 0));
- }
+ _totalLength = Math.Max(_totalLength, _totalLength + length.AsDecimal());
}
bool matchWidthLocally = false;
}
} // foreach
-
+ _totalLength = Math.Max(_totalLength, _totalLength + CellPadding.Height * (childrenCount - 1));
float heightSize = _totalLength;
heightSize = Math.Max(heightSize, SuggestedMinimumHeight.AsDecimal());
MeasuredSize heightSizeAndState = ResolveSizeAndState(new LayoutLength(heightSize + Padding.Top + Padding.Bottom), heightMeasureSpec, MeasuredSize.StateType.MeasuredSizeOK);
}
float length = childLayout.MeasuredHeight.Size.AsDecimal() + childMargin.Top + childMargin.Bottom;
- float cellPadding = i < numberOfChildren - 1 ? CellPadding.Height : 0;
-
- if (isExactly)
- {
- _totalLength += length;
- }
- else
- {
- float totalLength = _totalLength;
- _totalLength = Math.Max(_totalLength, _totalLength + length + cellPadding);
- }
+ _totalLength += length;
bool matchWidthLocally = (widthMode != MeasureSpecification.ModeType.Exactly) && (desiredChildWidth == LayoutParamPolicies.MatchParent);
float marginWidth = childMargin.Start + childMargin.End;
alternativeMaxWidth = Math.Max(alternativeMaxWidth, matchWidthLocally ? marginWidth : childWidth);
allFillParent = (allFillParent && desiredChildWidth == LayoutParamPolicies.MatchParent);
} // for loop
+ _totalLength = Math.Max(_totalLength, _totalLength + CellPadding.Height * (childrenCount - 1));
}
else
{