added in version 25.1.0
belongs to Maven artifact com.android.support:recyclerview-v7:28.0.0-alpha1

PagerSnapHelper

public class PagerSnapHelper
extends SnapHelper

java.lang.Object
   ↳ android.support.v7.widget.RecyclerView.OnFlingListener
     ↳ android.support.v7.widget.SnapHelper
       ↳ android.support.v7.widget.PagerSnapHelper


Implementation of the SnapHelper supporting pager style snapping in either vertical or horizontal orientation.

PagerSnapHelper can help achieve a similar behavior to ViewPager. Set both RecyclerView and the items of the RecyclerView.Adapter to have MATCH_PARENT height and width and then attach PagerSnapHelper to the RecyclerView using attachToRecyclerView(RecyclerView).

Summary

Public constructors

PagerSnapHelper()

Public methods

int[] calculateDistanceToFinalSnap(RecyclerView.LayoutManager layoutManager, View targetView)

Override this method to snap to a particular point within the target view or the container view on any axis.

View findSnapView(RecyclerView.LayoutManager layoutManager)

Override this method to provide a particular target view for snapping.

int findTargetSnapPosition(RecyclerView.LayoutManager layoutManager, int velocityX, int velocityY)

Override to provide a particular adapter target position for snapping.

Protected methods

LinearSmoothScroller createSnapScroller(RecyclerView.LayoutManager layoutManager)

This method is deprecated. use createScroller(LayoutManager) instead.

Inherited methods

From class android.support.v7.widget.SnapHelper