Skip to content

Commit

Permalink
* [Android] Fix some ConcurrentModificationException
Browse files Browse the repository at this point in the history
  • Loading branch information
miomin authored and YorkShen committed Jul 27, 2018
1 parent af068c0 commit 2ace11d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,14 @@ public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);

List<OnWXScrollListener> 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<size; ++i) {
if(i >= listeners.size()){
break;
}
listener = listeners.get(i);
if (listener != null) {
View topView = recyclerView.getChildAt(0);
if (topView != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<size; i++) {
if(i >= mRefreshOffsetChangedListeners.size()){
break;
}
listener = mRefreshOffsetChangedListeners.get(i);

if (listener != null) {
listener.onOffsetChanged(verticalOffset);
}
}
}

Expand Down

0 comments on commit 2ace11d

Please sign in to comment.