Closed GeniusRUS closed 6 years ago
Hi, Same problem, here a horrible tricks but that work
swipeRefreshLayout.setOnTouchListener((view, motionEvent) -> {
boolean triggeredByFastScroll = recyclerView.onTouchEvent(motionEvent);
if (triggeredByFastScroll) return true;
return view.onTouchEvent(motionEvent);
});
CrabeMan.
CrabeMan, thank for your reply. Yep, I solved this problem in the same way. But the developer would be nice to foresee this possibility "out of the box"
I'm not able to reproduce this issue. I've added a SwipeRefreshLayout
around the RecyclerView
in the sample project, and it is not triggered at all when fast scrolling.
If you can demonstrate the issue via a fork of the sample project, I'm happy to investigate further.
Hi, You can look at this example.
CrabeMan.
I checked out your example, on the branch prevent_touch_event_conflict
, and out-commented recyclerView.preventTouchEventConflict(swipeRefreshLayout);
. I wasn't able to reproduce the issue. (Testing on Nexus 6P running Android 8.1.0).
A few things:
Thanks for your tests, i has actually retest my branch without the recycleView.preventTouchEventConflict
. I have unfortunately not succeeded to reproduce the bug. But the bug is still present in my other project. I will investigate this, I'll keep you informed.
I'm currently running on Nokia 6 w/ Android 7.1.2
Edit: The problem is because I surround the FastScrollRecyclerView
with a FrameLayout
.
It look like
<Android.support.v4.widget.SwipeRefreshLayout>
<FrameLayout>
<other.layout />
<com.simplecityapps.recyclerview_fastscroll.views.FastScrollRecyclerView />
<other.layout />
</ FrameLayout>
</android.support.v4.widget.SwipeRefreshLayout>
By removing the FrameLayout the problem not appear.
Thanks. CrabeMan.
When you scroll down, the SwipeRefresh call is triggered. But the scroll goes up perfectly. A temporary solution is to set the SweepRefresh setEnabled(false) on start scrolling and setEnabled(true) on stop