attachToRecyclerView

Attaches the SnapHelper to the provided RecyclerView, by calling setOnFlingListener. You can call this method with null to detach it from the current RecyclerView.

Parameters

recyclerView

The RecyclerView instance to which you want to add this helper or null if you want to remove SnapHelper from the current RecyclerView.

Throws

if there is already a RecyclerView.OnFlingListener attached to the provided RecyclerView.