コード例 #1
0
ファイル: CSSNode.java プロジェクト: Cocoon-break/weex
 public CSSNode removeChildAt(int i) {
   //    Assertions.assertNotNull(mChildren);
   CSSNode removed = mChildren.remove(i);
   removed.mParent = null;
   dirty();
   return removed;
 }
コード例 #2
0
ファイル: CSSNode.java プロジェクト: Cocoon-break/weex
  public void addChildAt(CSSNode child, int i) {
    if (child.mParent != null) {
      throw new IllegalStateException("Child already has a parent, it must be removed first.");
    }
    if (mChildren == null) {
      // 4 is kinda arbitrary, but the default of 10 seems really high for an average View.
      mChildren = new ArrayList<CSSNode>(4);
    }

    mChildren.add(i, child);
    child.mParent = this;
    dirty();
  }
コード例 #3
0
ファイル: CSSNode.java プロジェクト: Cocoon-break/weex
  protected void dirty() {
    if (mLayoutState == LayoutState.DIRTY) {
      return;
    } else if (mLayoutState == LayoutState.HAS_NEW_LAYOUT) {
      throw new IllegalStateException(
          "Previous csslayout was ignored! markLayoutSeen() never called");
    }

    mLayoutState = LayoutState.DIRTY;

    if (mParent != null) {
      mParent.dirty();
    }
  }