Java Code Examples for com.taobao.weex.common.WXRenderStrategy#APPEND_ONCE

The following examples show how to use com.taobao.weex.common.WXRenderStrategy#APPEND_ONCE . 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: WXRenderStatement.java    From weex-uikit with MIT License 6 votes vote down vote up
/**
 * 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();
  }
}
 
Example 2
Source File: WXRenderStatement.java    From weex with Apache License 2.0 6 votes vote down vote up
/**
 * 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.getView() instanceof ScrollView) {
      mWXSDKInstance.setRootScrollView((ScrollView) scroller.getView());
    }
  }
  mWXSDKInstance.setRootView(mGodComponent.getRealView());
  if (mWXSDKInstance.getRenderStrategy() != WXRenderStrategy.APPEND_ONCE) {
    mWXSDKInstance.onViewCreated(mGodComponent);
  }
}
 
Example 3
Source File: CreateFinishAction.java    From ucar-weex-core with Apache License 2.0 5 votes vote down vote up
@Override
public void executeRender(RenderActionContext context) {
  WXSDKInstance instance = context.getInstance();
  if (instance.getRenderStrategy() == WXRenderStrategy.APPEND_ONCE) {
    instance.onCreateFinish();
  }
  instance.onRenderSuccess(mLayoutWidth, mLayoutHeight);
}
 
Example 4
Source File: WXRenderStatement.java    From weex-uikit with MIT License 5 votes vote down vote up
/**
 * weex render finish
 * @see  com.taobao.weex.dom.WXDomStatement#createFinish()
 */
void createFinish(int width, int height) {
  if (mWXSDKInstance.getRenderStrategy() == WXRenderStrategy.APPEND_ONCE) {
    mWXSDKInstance.onCreateFinish();
  }
  mWXSDKInstance.onRenderSuccess(width, height);
}
 
Example 5
Source File: WXRenderStatement.java    From weex with Apache License 2.0 5 votes vote down vote up
/**
 * weex render finish
 * @see  com.taobao.weex.dom.WXDomStatement#createFinish()
 */
void createFinish(int width, int height) {
  if (mWXSDKInstance.getRenderStrategy() == WXRenderStrategy.APPEND_ONCE) {
    mWXSDKInstance.onViewCreated(mGodComponent);
  }
  mWXSDKInstance.onRenderSuccess(width, height);
}