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


Java WXComponent.notifyAppearStateChange方法代码示例

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


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

示例1: notifyAppearStateChange

import com.taobao.weex.ui.component.WXComponent; //导入方法依赖的package包/类
@Override
public void notifyAppearStateChange(int firstVisible, int lastVisible, int directionX, int directionY) {
  //notify appear state
  Iterator<AppearanceHelper> it = mAppearComponents.values().iterator();
  String direction = directionY > 0 ? "up" : "down";
  if (getOrientation() == Constants.Orientation.HORIZONTAL) {
    direction = directionX > 0 ? "left" : "right";
  }

  while (it.hasNext()) {
    AppearanceHelper item = it.next();
    WXComponent component = item.getAwareChild();

    if (!item.isWatch()) {
      continue;
    }

    boolean outOfVisibleRange = item.getCellPositionINScollable() < firstVisible || item.getCellPositionINScollable() > lastVisible;

    View view = component.getHostView();
    if (view == null) {
      continue;
    }

    boolean visible = (!outOfVisibleRange) && item.isViewVisible();

    int result = item.setAppearStatus(visible);
    if (WXEnvironment.isApkDebugable()) {
      WXLogUtils.d("appear", "item " + item.getCellPositionINScollable() + " result " + result);
    }
    if (result == AppearanceHelper.RESULT_NO_CHANGE) {
      continue;
    }
    component.notifyAppearStateChange(result == AppearanceHelper.RESULT_APPEAR ? Constants.Event.APPEAR : Constants.Event.DISAPPEAR, direction);
  }
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:37,代码来源:WXListComponent.java

示例2: notifyAppearStateChange

import com.taobao.weex.ui.component.WXComponent; //导入方法依赖的package包/类
@Override
public void notifyAppearStateChange(int firstVisible, int lastVisible, int directionX, int directionY) {
  //notify appear state
  Iterator<AppearanceHelper> it = mAppearComponents.values().iterator();
  String direction = directionY > 0 ? Constants.Value.DIRECTION_UP :
      directionY < 0 ? Constants.Value.DIRECTION_DOWN : null;
  if (getOrientation() == Constants.Orientation.HORIZONTAL && directionX != 0) {
    direction = directionX > 0 ? Constants.Value.DIRECTION_LEFT : Constants.Value.DIRECTION_RIGHT;
  }

  if (mColumnCount > 0)
    visibleCellCount = (lastVisible - firstVisible) * mColumnCount;

  while (it.hasNext()) {
    AppearanceHelper item = it.next();
    WXComponent component = item.getAwareChild();

    if (!item.isWatch()) {
      continue;
    }

    boolean outOfVisibleRange = item.getCellPositionINScollable() < firstVisible || item.getCellPositionINScollable() > lastVisible;

    View view = component.getHostView();
    if (view == null) {
      continue;
    }

    boolean visible = (!outOfVisibleRange) && item.isViewVisible();

    int result = item.setAppearStatus(visible);
    if (WXEnvironment.isApkDebugable()) {
      WXLogUtils.d("appear", "item " + item.getCellPositionINScollable() + " result " + result);
    }
    if (result == AppearanceHelper.RESULT_NO_CHANGE) {
      continue;
    }
    component.notifyAppearStateChange(result == AppearanceHelper.RESULT_APPEAR ? Constants.Event.APPEAR : Constants.Event.DISAPPEAR, direction);
  }
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:41,代码来源:BasicListComponent.java

示例3: notifyAppearStateChange

import com.taobao.weex.ui.component.WXComponent; //导入方法依赖的package包/类
@Override
public void notifyAppearStateChange(int firstVisible, int lastVisible, int directionX, int directionY) {
  //notify appear state
  Iterator<AppearanceHelper> it = mAppearComponents.values().iterator();
  String direction = directionY > 0 ? Constants.Value.DIRECTION_UP :
      directionY < 0 ? Constants.Value.DIRECTION_DOWN : null;
  if (getOrientation() == Constants.Orientation.HORIZONTAL && directionX != 0) {
    direction = directionX > 0 ? Constants.Value.DIRECTION_LEFT : Constants.Value.DIRECTION_RIGHT;
  }

  while (it.hasNext()) {
    AppearanceHelper item = it.next();
    WXComponent component = item.getAwareChild();

    if (!item.isWatch()) {
      continue;
    }

    boolean outOfVisibleRange = item.getCellPositionINScollable() < firstVisible || item.getCellPositionINScollable() > lastVisible;

    View view = component.getHostView();
    if (view == null) {
      continue;
    }

    boolean visible = (!outOfVisibleRange) && item.isViewVisible();

    int result = item.setAppearStatus(visible);
    if (WXEnvironment.isApkDebugable()) {
      WXLogUtils.d("appear", "item " + item.getCellPositionINScollable() + " result " + result);
    }
    if (result == AppearanceHelper.RESULT_NO_CHANGE) {
      continue;
    }
    component.notifyAppearStateChange(result == AppearanceHelper.RESULT_APPEAR ? Constants.Event.APPEAR : Constants.Event.DISAPPEAR, direction);
  }
}
 
开发者ID:erguotou520,项目名称:weex-uikit,代码行数:38,代码来源:BasicListComponent.java


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