Skip to content

Commit

Permalink
Fixed the problem of adding new data to RecyclerView while in Fling s…
Browse files Browse the repository at this point in the history
…tate, the new items will continue to Fling
  • Loading branch information
dkzwm committed Sep 19, 2018
1 parent a5535db commit 6e250b0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2437,7 +2437,7 @@ public void onStopNestedScroll(@NonNull View target, int type) {
mIsLastOverScrollCanNotAbort = isCanNotAbortOverScrolling();
// Dispatch up our nested parent
stopNestedScroll(type);
if (!isAutoRefresh())
if (!isAutoRefresh() && type == ViewCompat.TYPE_TOUCH)
onFingerUp();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,13 @@ public static boolean scrollCompat(View view, float deltaY) {
return true;
} else if (view instanceof WebView
|| view instanceof ScrollView
|| view instanceof NestedScrollView
|| isRecyclerView(view)) {
|| view instanceof NestedScrollView) {
view.scrollBy(0, (int) deltaY);
return true;
} else if (isRecyclerView(view)) {
//Fix the problem of adding new data to RecyclerView while in Fling state,
//the new items will continue to Fling
((RecyclerView) view).stopScroll();
view.scrollBy(0, (int) deltaY);
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ public void onRefreshBegin(SmoothRefreshLayout layout, T indicator) {
mCachedDuration = duration;
mDrawable.setAlpha(255);
mDrawable.start();
invalidate();
}

@Override
Expand Down

0 comments on commit 6e250b0

Please sign in to comment.