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


Java WXComponent.applyLayoutAndEvent方法代码示例

本文整理汇总了Java中com.taobao.weex.ui.component.WXComponent.applyLayoutAndEvent方法的典型用法代码示例。如果您正苦于以下问题:Java WXComponent.applyLayoutAndEvent方法的具体用法?Java WXComponent.applyLayoutAndEvent怎么用?Java WXComponent.applyLayoutAndEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.taobao.weex.ui.component.WXComponent的用法示例。


在下文中一共展示了WXComponent.applyLayoutAndEvent方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createBody

import com.taobao.weex.ui.component.WXComponent; //导入方法依赖的package包/类
/**
 * create RootView ,every weex Instance View has a rootView;
 * @see com.taobao.weex.dom.WXDomStatement#createBody(JSONObject)
 */
void createBody(WXComponent component) {
  long start = System.currentTimeMillis();
  component.createView(mGodComponent, -1);
  if (WXEnvironment.isApkDebugable()) {
    WXLogUtils.renderPerformanceLog("createView", (System.currentTimeMillis() - start));
  }
  start = System.currentTimeMillis();
  component.applyLayoutAndEvent(component);
  component.bindData(component);

  if (WXEnvironment.isApkDebugable()) {
    WXLogUtils.renderPerformanceLog("bind", (System.currentTimeMillis() - start));
  }

  if (component instanceof WXScroller) {
    WXScroller scroller = (WXScroller) component;
    if (scroller.getInnerView() instanceof ScrollView) {
      mWXSDKInstance.setRootScrollView((ScrollView) scroller.getInnerView());
    }
  }
  mWXSDKInstance.setRootView(mGodComponent.getRealView());
  if (mWXSDKInstance.getRenderStrategy() != WXRenderStrategy.APPEND_ONCE) {
    mWXSDKInstance.onViewCreated(mGodComponent);
  }
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:30,代码来源:WXRenderStatement.java

示例2: createBody

import com.taobao.weex.ui.component.WXComponent; //导入方法依赖的package包/类
/**
 * create RootView ,every weex Instance View has a rootView;
 * @see com.taobao.weex.dom.WXDomStatement#createBody(JSONObject)
 */
void createBody(WXComponent component) {
  long start = System.currentTimeMillis();
  component.createView();
  if (WXEnvironment.isApkDebugable()) {
    WXLogUtils.renderPerformanceLog("createView", (System.currentTimeMillis() - start));
  }
  start = System.currentTimeMillis();
  component.applyLayoutAndEvent(component);
  component.bindData(component);

  if (WXEnvironment.isApkDebugable()) {
    WXLogUtils.renderPerformanceLog("bind", (System.currentTimeMillis() - start));
  }

  if (component instanceof WXScroller) {
    WXScroller scroller = (WXScroller) component;
    if (scroller.getInnerView() instanceof ScrollView) {
      mWXSDKInstance.setRootScrollView((ScrollView) scroller.getInnerView());
    }
  }
  mWXSDKInstance.onRootCreated(component);
  if (mWXSDKInstance.getRenderStrategy() != WXRenderStrategy.APPEND_ONCE) {
    mWXSDKInstance.onCreateFinish();
  }
}
 
开发者ID:erguotou520,项目名称:weex-uikit,代码行数:30,代码来源:WXRenderStatement.java

示例3: addComponent

import com.taobao.weex.ui.component.WXComponent; //导入方法依赖的package包/类
/**
 * @see com.taobao.weex.dom.WXDomStatement#addDom(JSONObject, String, int)
 */
void addComponent(WXComponent component, String parentRef, int index) {
  WXVContainer parent = (WXVContainer) mRegistry.get(parentRef);
  if (parent == null || component == null) {
    return;
  }
  component.createView(parent, index);
  component.applyLayoutAndEvent(component);
  component.bindData(component);
  parent.addChild(component, index);
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:14,代码来源:WXRenderStatement.java

示例4: addComponent

import com.taobao.weex.ui.component.WXComponent; //导入方法依赖的package包/类
/**
 * @see com.taobao.weex.dom.WXDomStatement#addDom(JSONObject, String, int)
 */
void addComponent(WXComponent component, String parentRef, int index) {
  WXVContainer parent = (WXVContainer) mRegistry.get(parentRef);
  if (parent == null || component == null) {
    return;
  }

  parent.addChild(component, index);
  parent.createChildViewAt(index);
  component.applyLayoutAndEvent(component);
  component.bindData(component);
}
 
开发者ID:erguotou520,项目名称:weex-uikit,代码行数:15,代码来源:WXRenderStatement.java

示例5: onCreateViewHolder

import com.taobao.weex.ui.component.WXComponent; //导入方法依赖的package包/类
/**
 * Create an instance of {@link ListBaseViewHolder} for the given viewType (not for the given
 * index). This method will look up for the first component that fits the viewType requirement and
 * doesn't be used. Then create the certain type of view, detach the view f[rom the component.
 *
 * @param parent   the ViewGroup into which the new view will be inserted
 * @param viewType the type of the new view
 * @return the created view holder.
 */
@Override
public ListBaseViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    if (mChildren != null) {
        if (mViewTypes == null)
            return createVHForFakeComponent(viewType);
        ArrayList<WXComponent> mTypes = mViewTypes.get(viewType);
        checkRecycledViewPool(viewType);
        if (mTypes == null)
            return createVHForFakeComponent(viewType);

        for (int i = 0; i < mTypes.size(); i++) {
            WXComponent component = mTypes.get(i);
            if (component == null
                    || component.isUsing()) {
                continue;
            }
            if (component.getDomObject()!=null && component.getDomObject().isFixed()) {
                return createVHForFakeComponent(viewType);
            } else {
                if (component instanceof WXCell) {
                    if (component.getRealView() != null) {
                        return new ListBaseViewHolder(component, viewType);
                    } else {
                        component.lazy(false);
                        component.createView(this, -1);
                        component.applyLayoutAndEvent(component);
                        return new ListBaseViewHolder(component, viewType);
                    }
                } else {
                    WXLogUtils.e(TAG, "List cannot include element except cell、header、fixed、refresh and loading");
                    return createVHForFakeComponent(viewType);
                }
            }
        }
    }
    if(WXEnvironment.isApkDebugable()) {
        WXLogUtils.e(TAG, "Cannot find request viewType: " + viewType);
    }
    return createVHForFakeComponent(viewType);
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:50,代码来源:WXListComponent.java

示例6: onCreateViewHolder

import com.taobao.weex.ui.component.WXComponent; //导入方法依赖的package包/类
/**
 * Create an instance of {@link ListBaseViewHolder} for the given viewType (not for the given
 * index). This  markComponentUsable();method will look up for the first component that fits the viewType requirement and
 * doesn't be used. Then create the certain type of view, detach the view f[rom the component.
 *
 * @param parent   the ViewGroup into which the new view will be inserted
 * @param viewType the type of the new view
 * @return the created view holder.
 */
@Override
public ListBaseViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
  if (mChildren != null) {
    if (mViewTypes == null)
      return createVHForFakeComponent(viewType);
    ArrayList<WXComponent> mTypes = mViewTypes.get(viewType);
    checkRecycledViewPool(viewType);
    if (mTypes == null)
      return createVHForFakeComponent(viewType);

    for (int i = 0; i < mTypes.size(); i++) {
      WXComponent component = mTypes.get(i);
      if (component == null
          || component.isUsing()) {
        continue;
      }
      if (component.getDomObject() != null && component.getDomObject().isFixed()) {
        return createVHForFakeComponent(viewType);
      } else {
        if (component instanceof WXCell) {
          if (component.getRealView() != null) {
            return new ListBaseViewHolder(component, viewType);
          } else {
            ((WXCell) component).lazy(false);
            component.createView();
            component.applyLayoutAndEvent(component);
            return new ListBaseViewHolder(component, viewType);
          }
        } else if (component instanceof WXBaseRefresh) {
          return createVHForRefreshComponent(viewType);
        } else {
          WXLogUtils.e(TAG, "List cannot include element except cell、header、fixed、refresh and loading");
          return createVHForFakeComponent(viewType);
        }
      }
    }
  }
  if (WXEnvironment.isApkDebugable()) {
    WXLogUtils.e(TAG, "Cannot find request viewType: " + viewType);
  }
  return createVHForFakeComponent(viewType);
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:52,代码来源:BasicListComponent.java

示例7: onCreateViewHolder

import com.taobao.weex.ui.component.WXComponent; //导入方法依赖的package包/类
/**
 * Create an instance of {@link ListBaseViewHolder} for the given viewType (not for the given
 * index). This method will look up for the first component that fits the viewType requirement and
 * doesn't be used. Then create the certain type of view, detach the view f[rom the component.
 *
 * @param parent   the ViewGroup into which the new view will be inserted
 * @param viewType the type of the new view
 * @return the created view holder.
 */
@Override
public ListBaseViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
  if (mChildren != null) {
    if (mViewTypes == null)
      return createVHForFakeComponent(viewType);
    ArrayList<WXComponent> mTypes = mViewTypes.get(viewType);
    checkRecycledViewPool(viewType);
    if (mTypes == null)
      return createVHForFakeComponent(viewType);

    for (int i = 0; i < mTypes.size(); i++) {
      WXComponent component = mTypes.get(i);
      if (component == null
          || component.isUsing()) {
        continue;
      }
      if (component.getDomObject() != null && component.getDomObject().isFixed()) {
        return createVHForFakeComponent(viewType);
      } else {
        if (component instanceof WXCell) {
          if (component.getRealView() != null) {
            return new ListBaseViewHolder(component, viewType);
          } else {
            ((WXCell) component).lazy(false);
            component.createView();
            component.applyLayoutAndEvent(component);
            return new ListBaseViewHolder(component, viewType);
          }
        } else if (component instanceof WXBaseRefresh) {
          return createVHForRefreshComponent(viewType);
        } else {
          WXLogUtils.e(TAG, "List cannot include element except cell、header、fixed、refresh and loading");
          return createVHForFakeComponent(viewType);
        }
      }
    }
  }
  if (WXEnvironment.isApkDebugable()) {
    WXLogUtils.e(TAG, "Cannot find request viewType: " + viewType);
  }
  return createVHForFakeComponent(viewType);
}
 
开发者ID:erguotou520,项目名称:weex-uikit,代码行数:52,代码来源:BasicListComponent.java


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