Belzebub Belzebub - 3 years ago 178
Android Question

How to remove SnapHelper from a RecyclerView

I use attachToRecyclerView(RecyclerView) and it works as expeced.

Question: at some point I want the same recyclerView to scroll normally, how to achieve that?

Code:

PagerSnapHelper pagerSnapHelper = new PagerSnapHelper();
pagerSnapHelper.attachToRecyclerView(recyclerView);

Answer Source

I faced the same problem. Calling

clearOnScrollListeners();
setOnFlingListener(null);

on the RecyclerView instance did the trick for me. Calling only setOnFlingListener(null); wasn't enough in my case

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download