/** * Resets this instance to its default state. This method is meant to be used when recycling * {@link CSSNode} instances. */ public void reset() { if (mParent != null || (mChildren != null && mChildren.size() > 0)) { throw new IllegalStateException("You should not reset an attached CSSNode"); } cssstyle.reset(); csslayout.resetResult(); lineIndex = 0; mLayoutState = LayoutState.DIRTY; }
private void toStringWithIndentation(StringBuilder result, int level) { // Spaces and tabs are dropped by IntelliJ logcat integration, so rely on __ instead. StringBuilder indentation = new StringBuilder(); for (int i = 0; i < level; ++i) { indentation.append("__"); } result.append(indentation.toString()); result.append(csslayout.toString()); result.append(cssstyle.toString()); if (getChildCount() == 0) { return; } result.append(", children: [\n"); for (int i = 0; i < getChildCount(); i++) { getChildAt(i).toStringWithIndentation(result, level + 1); result.append("\n"); } result.append(indentation + "]"); }
public void setMaxHeight(float maxHeight) { if (!valuesEqual(cssstyle.maxHeight, maxHeight)) { cssstyle.maxHeight = maxHeight; dirty(); } }
public void setMinHeight(float minHeight) { if (!valuesEqual(cssstyle.minHeight, minHeight)) { cssstyle.minHeight = minHeight; dirty(); } }
public void setMaxWidth(float maxWidth) { if (!valuesEqual(cssstyle.maxWidth, maxWidth)) { cssstyle.maxWidth = maxWidth; dirty(); } }
public void setMinWidth(float minWidth) { if (!valuesEqual(cssstyle.minWidth, minWidth)) { cssstyle.minWidth = minWidth; dirty(); } }
public void setFlex(float flex) { if (!valuesEqual(cssstyle.flex, flex)) { cssstyle.flex = flex; dirty(); } }
public void setWrap(CSSWrap flexWrap) { if (cssstyle.flexWrap != flexWrap) { cssstyle.flexWrap = flexWrap; dirty(); } }
public void setPositionType(CSSPositionType positionType) { if (cssstyle.positionType != positionType) { cssstyle.positionType = positionType; dirty(); } }
public void setAlignSelf(CSSAlign alignSelf) { if (cssstyle.alignSelf != alignSelf) { cssstyle.alignSelf = alignSelf; dirty(); } }
public void setAlignItems(CSSAlign alignItems) { if (cssstyle.alignItems != alignItems) { cssstyle.alignItems = alignItems; dirty(); } }
public void setJustifyContent(CSSJustify justifyContent) { if (cssstyle.justifyContent != justifyContent) { cssstyle.justifyContent = justifyContent; dirty(); } }
public void setFlexDirection(CSSFlexDirection flexDirection) { if (cssstyle.flexDirection != flexDirection) { cssstyle.flexDirection = flexDirection; dirty(); } }
public void setDirection(CSSDirection direction) { if (cssstyle.direction != direction) { cssstyle.direction = direction; dirty(); } }