/** * 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; }
/** Performs the actual csslayout and saves the results in {@link #csslayout} */ public void calculateLayout(CSSLayoutContext layoutContext) { csslayout.resetResult(); LayoutEngine.layoutNode(layoutContext, this, CSSConstants.UNDEFINED, null); }