PagerSnapHelper

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

PagerSnapHelper can help achieve a similar behavior to androidx.viewpager.widget.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.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
Override this method to snap to a particular point within the target view or the container view on any axis.
Link copied to clipboard
Override this method to provide a particular target view for snapping.
Link copied to clipboard
open fun findTargetSnapPosition(layoutManager: RecyclerView.LayoutManager, velocityX: Int, velocityY: Int): Int
Override to provide a particular adapter target position for snapping.