コード例 #1
0
ファイル: WXDomStatement.java プロジェクト: Rowandjj/weex
 private void layoutAfter(WXDomObject dom) {
   if (dom == null || !dom.hasUpdate() || mDestroy) {
     return;
   }
   dom.layoutAfter();
   int count = dom.childCount();
   for (int i = 0; i < count; ++i) {
     layoutAfter(dom.getChild(i));
   }
 }
コード例 #2
0
ファイル: WXDomStatement.java プロジェクト: Rowandjj/weex
  /**
   * Walk through the dom tree and create command object of re-calculating {@link
   * android.view.ViewGroup.LayoutParams} for dom that is old.
   *
   * @param dom the root dom of the walk through.
   */
  private void applyUpdate(WXDomObject dom) {
    if (dom == null) {
      return;
    }
    if (dom.hasUpdate()) {
      dom.markUpdateSeen();
      if (!dom.isYoung()) {
        final WXDomObject copy = dom.clone();
        if (copy == null) {
          return;
        }
        mNormalTasks.add(
            new IWXRenderTask() {

              @Override
              public void execute() {
                mWXRenderManager.setLayout(mInstanceId, copy.getRef(), copy);
              }

              @Override
              public String toString() {
                return "setLayout";
              }
            });
        if (dom.getExtra() != null) {
          mNormalTasks.add(
              new IWXRenderTask() {

                @Override
                public void execute() {
                  mWXRenderManager.setExtra(mInstanceId, copy.getRef(), copy.getExtra());
                }

                @Override
                public String toString() {
                  return "setExtra";
                }
              });
        }
      }
    }
    int count = dom.childCount();
    for (int i = 0; i < count; ++i) {
      applyUpdate(dom.getChild(i));
    }
  }