diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java b/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java index 14dc743974..c6adf8064a 100644 --- a/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java +++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java @@ -289,8 +289,14 @@ public void onScrollStateChanged(RecyclerView recyclerView, int newState) { super.onScrollStateChanged(recyclerView, newState); List listeners = getInstance().getWXScrollListeners(); - if (listeners != null && listeners.size() > 0) { - for (OnWXScrollListener listener : listeners) { + int size; + OnWXScrollListener listener; + if (listeners != null && (size = listeners.size()) > 0) { + for (int i=0; i= listeners.size()){ + break; + } + listener = listeners.get(i); if (listener != null) { View topView = recyclerView.getChildAt(0); if (topView != null) { diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/core/WXSwipeLayout.java b/android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/core/WXSwipeLayout.java index e6818e1681..9f66c03d9c 100644 --- a/android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/core/WXSwipeLayout.java +++ b/android/sdk/src/main/java/com/taobao/weex/ui/view/refresh/core/WXSwipeLayout.java @@ -767,8 +767,17 @@ public boolean removeOnRefreshOffsetChangedListener(@Nullable OnRefreshOffsetCha } private void notifyOnRefreshOffsetChangedListener(int verticalOffset) { - for(OnRefreshOffsetChangedListener listener : mRefreshOffsetChangedListeners) { - listener.onOffsetChanged(verticalOffset); + int size = mRefreshOffsetChangedListeners.size(); + OnRefreshOffsetChangedListener listener; + for (int i=0; i= mRefreshOffsetChangedListeners.size()){ + break; + } + listener = mRefreshOffsetChangedListeners.get(i); + + if (listener != null) { + listener.onOffsetChanged(verticalOffset); + } } }