/**
* @see Manager#sublayout(int, int)
*/
protected void sublayout(int width, int height) {
Field firstField;
Field secondField;
if (_giveLeftFieldPriority) {
firstField = _leftField;
secondField = _rightField;
} else {
firstField = _rightField;
secondField = _leftField;
}
int maxHeight = 0;
final int leftFieldLeftMargin = _leftField.getMarginLeft();
final int leftFieldRightMargin = _leftField.getMarginRight();
final int rightFieldLeftMargin = _rightField.getMarginLeft();
final int rightFieldRightMargin = _rightField.getMarginRight();
final int firstFieldMarginBottom = firstField.getMarginBottom();
final int firstFieldMarginTop = firstField.getMarginTop();
final int secondFieldMarginBottom = secondField.getMarginBottom();
final int secondFieldMarginTop = secondField.getMarginTop();
int availableWidth = width;
availableWidth -= leftFieldLeftMargin;
availableWidth -= Math.max(leftFieldRightMargin, rightFieldLeftMargin);
availableWidth -= rightFieldRightMargin;
layoutChild(firstField, availableWidth, height - firstFieldMarginTop
- firstFieldMarginBottom);
maxHeight =
Math.max(maxHeight, firstFieldMarginTop
+ firstField.getHeight() + firstFieldMarginBottom);
availableWidth -= firstField.getWidth();
layoutChild(secondField, availableWidth, height - secondFieldMarginTop
- secondFieldMarginBottom);
maxHeight =
Math.max(maxHeight, secondFieldMarginTop
+ secondField.getHeight() + secondFieldMarginBottom);
availableWidth -= secondField.getWidth();
if (!isStyle(Field.USE_ALL_HEIGHT)) {
height = maxHeight;
}
if (!isStyle(Field.USE_ALL_WIDTH)) {