当前位置: 首页>>代码示例>>Java>>正文


Java WXVContainer类代码示例

本文整理汇总了Java中com.taobao.weex.ui.component.WXVContainer的典型用法代码示例。如果您正苦于以下问题:Java WXVContainer类的具体用法?Java WXVContainer怎么用?Java WXVContainer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


WXVContainer类属于com.taobao.weex.ui.component包,在下文中一共展示了WXVContainer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateDomObj

import com.taobao.weex.ui.component.WXVContainer; //导入依赖的package包/类
/**
 * Update the specified component's dom and mark it as old.
 * @param component the component to be updated
 */
private void updateDomObj(WXComponent component) {
  if (component == null) {
    return;
  }
  WXDomObject domObject = mRegistry.get(component.getRef());
  if (domObject == null) {
    return;
  }
  domObject.old();
  component.updateDom(domObject.clone());
  if (component instanceof WXVContainer) {
    WXVContainer container = (WXVContainer) component;
    int count = container.childCount();
    for (int i = 0; i < count; ++i) {
      updateDomObj(container.getChild(i));
    }
  }
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:23,代码来源:WXDomStatement.java

示例2: loadConstructor

import com.taobao.weex.ui.component.WXVContainer; //导入依赖的package包/类
private void loadConstructor(){
  Class<? extends WXComponent> c = mCompClz;
  Constructor<? extends WXComponent> constructor;
  try {
    constructor = c.getConstructor(WXSDKInstance.class, WXDomObject.class, WXVContainer.class, boolean.class);
  } catch (NoSuchMethodException e) {
    WXLogUtils.d("ClazzComponentCreator","Use deprecated component constructor");
    try {
      //compatible deprecated constructor
      constructor = c.getConstructor(WXSDKInstance.class, WXDomObject.class, WXVContainer.class,String.class, boolean.class);
    } catch (NoSuchMethodException e1) {
      throw new WXRuntimeException("Can't find constructor of component.");
    }
  }
  mConstructor = constructor;
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:17,代码来源:SimpleComponentHolder.java

示例3: createBodyOnDomThread

import com.taobao.weex.ui.component.WXVContainer; //导入依赖的package包/类
WXComponent createBodyOnDomThread(WXDomObject dom) {
  if (mWXSDKInstance == null) {
    return null;
  }
  WXDomObject domObject = new WXDomObject();
  WXDomObject.prepareGod(domObject);
  mGodComponent = (WXVContainer) WXComponentFactory.newInstance(mWXSDKInstance, domObject, null);
  mGodComponent.createView(null, -1);
  if (mGodComponent == null) {
    if (WXEnvironment.isApkDebugable()) {
      WXLogUtils.e("rootView failed!");
    }
    //TODO error callback
    return null;
  }
  FrameLayout frameLayout = (FrameLayout) mGodComponent.getHostView();
  ViewGroup.LayoutParams layoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
  frameLayout.setLayoutParams(layoutParams);
  frameLayout.setBackgroundColor(Color.TRANSPARENT);

  WXComponent component = generateComponentTree(dom, mGodComponent);
  mGodComponent.addChild(component);
  mRegistry.put(component.getRef(), component);
  return component;
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:26,代码来源:WXRenderStatement.java

示例4: clearRegistryForComponent

import com.taobao.weex.ui.component.WXVContainer; //导入依赖的package包/类
/**
 * Clear registry information that current instance contains.
 */
private void clearRegistryForComponent(WXComponent component) {
  WXComponent removedComponent = mRegistry.remove(component.getDomObject().getRef());
  if (removedComponent != null) {
    removedComponent.removeAllEvent();
    removedComponent.removeStickyStyle();
  }
  if (component instanceof WXVContainer) {
    WXVContainer container = (WXVContainer) component;
    int count = container.childCount();
    for (int i = count - 1; i >= 0; --i) {
      clearRegistryForComponent(container.getChild(i));
    }
  }

}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:19,代码来源:WXRenderStatement.java

示例5: generateComponentTree

import com.taobao.weex.ui.component.WXVContainer; //导入依赖的package包/类
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.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;
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:23,代码来源:WXRenderStatement.java

示例6: updateDomObj

import com.taobao.weex.ui.component.WXVContainer; //导入依赖的package包/类
/**
 * Update the specified component's dom and mark it as old.
 * @param component the component to be updated
 */
private void updateDomObj(WXComponent component) {
  if (component == null) {
    return;
  }
  WXDomObject domObject = mRegistry.get(component.getRef());
  if (domObject == null) {
    return;
  }
  domObject.old();
  component.updateDom(domObject);
  if (component instanceof WXVContainer) {
    WXVContainer container = (WXVContainer) component;
    int count = container.childCount();
    for (int i = 0; i < count; ++i) {
      updateDomObj(container.getChild(i));
    }
  }
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:23,代码来源:DOMActionContextImpl.java

示例7: generateComponentTree

import com.taobao.weex.ui.component.WXVContainer; //导入依赖的package包/类
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;
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:22,代码来源:AbstractAddElementAction.java

示例8: loadConstructor

import com.taobao.weex.ui.component.WXVContainer; //导入依赖的package包/类
private void loadConstructor(){
  Class<? extends WXComponent> c = mCompClz;
  Constructor<? extends WXComponent> constructor;
  try {
    constructor = c.getConstructor(WXSDKInstance.class, WXDomObject.class, WXVContainer.class);
  } catch (NoSuchMethodException e) {
    WXLogUtils.d("ClazzComponentCreator","Use deprecated component constructor");
    try {
      //compatible deprecated constructor with 4 args
      constructor = c.getConstructor(WXSDKInstance.class, WXDomObject.class, WXVContainer.class, boolean.class);
    } catch (NoSuchMethodException e1) {
      try {
        //compatible deprecated constructor with 5 args
        constructor = c.getConstructor(WXSDKInstance.class, WXDomObject.class, WXVContainer.class,String.class, boolean.class);
      } catch (NoSuchMethodException e2) {
        throw new WXRuntimeException("Can't find constructor of component.");
      }
    }
  }
  mConstructor = constructor;
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:22,代码来源:SimpleComponentHolder.java

示例9: createInstance

import com.taobao.weex.ui.component.WXVContainer; //导入依赖的package包/类
@Override
public WXComponent createInstance(WXSDKInstance instance, WXDomObject node, WXVContainer parent) throws IllegalAccessException, InvocationTargetException, InstantiationException {
  if(mConstructor == null){
    loadConstructor();
  }
  int parameters = mConstructor.getParameterTypes().length;
  WXComponent component;

  if(parameters == 3){
    component =  mConstructor.newInstance(instance,node,parent);
  }else if(parameters == 4){
    component =  mConstructor.newInstance(instance,node,parent,false);
  }else{
    //compatible deprecated constructor
    component =  mConstructor.newInstance(instance,node,parent,instance.getInstanceId(),parent.isLazy());
  }
  return component;
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:19,代码来源:SimpleComponentHolder.java

示例10: generateComponentTree

import com.taobao.weex.ui.component.WXVContainer; //导入依赖的package包/类
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;
}
 
开发者ID:erguotou520,项目名称:weex-uikit,代码行数:22,代码来源:WXRenderStatement.java

示例11: getComponentNumOfNode

import com.taobao.weex.ui.component.WXVContainer; //导入依赖的package包/类
private int getComponentNumOfNode(@NonNull WXComponent rootNode) {
    Deque<WXComponent> deque = new ArrayDeque<>();
    deque.add(rootNode);
    int viewNum = 0;
    while (!deque.isEmpty()) {
        WXComponent node = deque.removeFirst();
        viewNum++;
        if (node instanceof WXVContainer) {
            WXVContainer container = (WXVContainer) node;
            for (int i = 0, count = container.childCount(); i < count; i++) {
                deque.add(container.getChild(i));
            }
        }
    }
    return viewNum;
}
 
开发者ID:weexteam,项目名称:weex-analyzer-android,代码行数:17,代码来源:DomTracker.java

示例12: createBodyOnDomThread

import com.taobao.weex.ui.component.WXVContainer; //导入依赖的package包/类
WXComponent createBodyOnDomThread(WXDomObject dom) {
  if (mWXSDKInstance == null) {
    return null;
  }
  WXDomObject domObject = new WXDomObject();
  domObject.type = WXBasicComponentType.DIV;
  domObject.ref = "god";
  mGodComponent = (WXVContainer) WXComponentFactory.newInstance(mWXSDKInstance, domObject, null);
  mGodComponent.createView(null, -1);
  if (mGodComponent == null) {
    if (WXEnvironment.isApkDebugable()) {
      WXLogUtils.e("rootView failed!");
    }
    //TODO error callback
    return null;
  }
  FrameLayout frameLayout = (FrameLayout) mGodComponent.getView();
  ViewGroup.LayoutParams layoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
  frameLayout.setLayoutParams(layoutParams);
  frameLayout.setBackgroundColor(Color.TRANSPARENT);

  WXComponent component = generateComponentTree(dom, mGodComponent);
  mGodComponent.addChild(component);
  mRegistry.put(component.getRef(), component);
  return component;
}
 
开发者ID:Laisly,项目名称:weex,代码行数:27,代码来源:WXRenderStatement.java

示例13: clearRegistryForComponent

import com.taobao.weex.ui.component.WXVContainer; //导入依赖的package包/类
/**
 * Clear registry information that current instance contains.
 */
private void clearRegistryForComponent(WXComponent component) {
  WXComponent removedComponent = mRegistry.remove(component.getDomObject().ref);
  if (removedComponent != null) {
    removedComponent.removeAllEvent();
    removedComponent.removeStickyStyle();
  }
  if (component instanceof WXVContainer) {
    WXVContainer container = (WXVContainer) component;
    int count = container.childCount();
    for (int i = count - 1; i >= 0; --i) {
      clearRegistryForComponent(container.getChild(i));
    }
  }

}
 
开发者ID:Laisly,项目名称:weex,代码行数:19,代码来源:WXRenderStatement.java

示例14: generateComponentTree

import com.taobao.weex.ui.component.WXVContainer; //导入依赖的package包/类
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;
}
 
开发者ID:Laisly,项目名称:weex,代码行数:23,代码来源:WXRenderStatement.java

示例15: createInstance

import com.taobao.weex.ui.component.WXVContainer; //导入依赖的package包/类
public WXComponent createInstance(WXSDKInstance instance, WXDomObject node, WXVContainer parent, boolean lazy) throws IllegalAccessException, InvocationTargetException, InstantiationException {
  if(mConstructor == null){
    generate();
  }
  int parameters = mConstructor.getParameterTypes().length;
  WXComponent component;
  if(parameters == 4){
    component =  mConstructor.newInstance(instance,node,parent,lazy);
  }else{
    //compatible deprecated constructor
    component =  mConstructor.newInstance(instance,node,parent,instance.getInstanceId(),lazy);
  }

  component.setHolder(this);
  return component;
}
 
开发者ID:Laisly,项目名称:weex,代码行数:17,代码来源:ComponentHolder.java


注:本文中的com.taobao.weex.ui.component.WXVContainer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。