Search in sources :

Example 6 with WXVContainer

use of com.taobao.weex.ui.component.WXVContainer in project weex-example by KalicyZhou.

the class WXRenderStatement method move.

/**
   * @see com.taobao.weex.dom.WXDomStatement#moveDom(String, String, int)
   */
void move(String ref, String parentRef, int index) {
    WXComponent component = mRegistry.get(ref);
    WXComponent newParent = mRegistry.get(parentRef);
    if (component == null || component.getParent() == null || newParent == null || !(newParent instanceof WXVContainer)) {
        return;
    }
    WXVContainer oldParent = component.getParent();
    oldParent.remove(component, false);
    ((WXVContainer) newParent).addChild(component, index);
}
Also used : WXVContainer(com.taobao.weex.ui.component.WXVContainer) WXComponent(com.taobao.weex.ui.component.WXComponent)

Example 7 with WXVContainer

use of com.taobao.weex.ui.component.WXVContainer in project weex-example by KalicyZhou.

the class WXRenderStatement method addComponent.

/**
   * @see com.taobao.weex.dom.WXDomStatement#addDom(JSONObject, String, int)
   */
void addComponent(WXDomObject dom, String parentRef, int index) {
    WXVContainer parent = (WXVContainer) mRegistry.get(parentRef);
    WXComponent component = generateComponentTree(dom, parent);
    parent.addChild(component, index);
}
Also used : WXVContainer(com.taobao.weex.ui.component.WXVContainer) WXComponent(com.taobao.weex.ui.component.WXComponent)

Aggregations

WXVContainer (com.taobao.weex.ui.component.WXVContainer)7 WXComponent (com.taobao.weex.ui.component.WXComponent)5 WXDomObject (com.taobao.weex.dom.WXDomObject)1