本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}