コード例 #1
0
ファイル: CSSNode.java プロジェクト: Cocoon-break/weex
  /**
   * 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;
  }
コード例 #2
0
ファイル: CSSNode.java プロジェクト: Cocoon-break/weex
  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 + "]");
  }
コード例 #3
0
ファイル: CSSNode.java プロジェクト: Cocoon-break/weex
 /** 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);
 }