Java Code Examples for com.taobao.weex.dom.WXDomObject#childCount()

The following examples show how to use com.taobao.weex.dom.WXDomObject#childCount() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractAddElementAction.java    From ucar-weex-core with Apache License 2.0 6 votes vote down vote up
protected WXComponent generateComponentTree(DOMActionContext context, WXDomObject dom, WXVContainer parent) {
  if (dom == null) {
    return null;
  }
  WXComponent component = WXComponentFactory.newInstance(context.getInstance(), dom, parent);

  context.registerComponent(dom.getRef(), component);
  if (component instanceof WXVContainer) {
    WXVContainer parentC = (WXVContainer) component;
    int count = dom.childCount();
    WXDomObject child = null;
    for (int i = 0; i < count; ++i) {
      child = dom.getChild(i);
      if (child != null) {
        parentC.addChild(generateComponentTree(context, child, parentC));
      }
    }
  }

  return component;
}
 
Example 2
Source File: WXRenderStatement.java    From weex-uikit with MIT License 6 votes vote down vote up
private WXComponent generateComponentTree(WXDomObject dom, WXVContainer parent) {
  if (dom == null ) {
    return null;
  }
  WXComponent component = WXComponentFactory.newInstance(mWXSDKInstance, dom,parent);

  mRegistry.put(dom.getRef(), component);
  if (component instanceof WXVContainer) {
    WXVContainer parentC = (WXVContainer) component;
    int count = dom.childCount();
    WXDomObject child = null;
    for (int i = 0; i < count; ++i) {
      child = dom.getChild(i);
      if (child != null) {
        parentC.addChild(generateComponentTree(child, parentC));
      }
    }
  }

  return component;
}
 
Example 3
Source File: WXRenderStatement.java    From weex with Apache License 2.0 6 votes vote down vote up
private WXComponent generateComponentTree(WXDomObject dom, WXVContainer parent) {
  if (dom == null || parent == null) {
    return null;
  }
  WXComponent component = WXComponentFactory.newInstance(mWXSDKInstance, dom,
                                                         parent, parent.isLazy());

  mRegistry.put(dom.ref, component);
  if (component instanceof WXVContainer) {
    WXVContainer parentC = (WXVContainer) component;
    int count = dom.childCount();
    WXDomObject child = null;
    for (int i = 0; i < count; ++i) {
      child = dom.getChild(i);
      if (child != null) {
        parentC.addChild(generateComponentTree(child, parentC));
      }
    }
  }

  return component;
}
 
Example 4
Source File: AbstractAddElementAction.java    From ucar-weex-core with Apache License 2.0 4 votes vote down vote up
public void addAnimationForDomTree(DOMActionContext context, WXDomObject domObject) {
  context.addAnimationForElement(domObject.getRef(), domObject.getStyles());
  for (int i = 0; i < domObject.childCount(); i++) {
    addAnimationForDomTree(context, domObject.getChild(i));
  }
}