preProcessConstraintHeightThisLevel();
}
private void preProcessConstraintHeightThisLevel() {
// try the original height value first
SizeValue myHeight = getConstraintHeight();
// is it empty and we have an layoutManager there's still hope for a height constraint
if (layoutManager != null && (myHeight == null || isCalcHeightConstraint)) {
// collect all child layoutPart that have a fixed px size in a list
List < LayoutPart > layoutPartChild = new ArrayList < LayoutPart >();
for (int i=0; i<elements.size(); i++) {
Element e = elements.get(i);
SizeValue childHeight = e.getConstraintHeight();
if (childHeight != null && childHeight.isPixel()) {
layoutPartChild.add(e.layoutPart);
}
}
// if all (!) child elements have a px fixed height we can calculate a new height constraint for this element!
if (elements.size() == layoutPartChild.size()) {
SizeValue newHeight = layoutManager.calculateConstraintHeight(this.layoutPart, layoutPartChild);
if (newHeight != null) {
setConstraintHeight(newHeight);
isCalcHeightConstraint = true;
}
}