SnapHelper
(SESL variant) Class intended to support snapping for a RecyclerView.
SnapHelper tries to handle fling as well but for this to work properly, the RecyclerView.LayoutManager must implement the RecyclerView.SmoothScroller.ScrollVectorProvider interface or you should override onFling and handle fling manually.
Inheritors
Functions
Link copied to clipboard
Attaches the SnapHelper to the provided RecyclerView, by calling setOnFlingListener.
Link copied to clipboard
abstract fun calculateDistanceToFinalSnap(@NonNull layoutManager: RecyclerView.LayoutManager, @NonNull targetView: View): Array<Int>
Override this method to snap to a particular point within the target view or the container view on any axis.
Link copied to clipboard
Calculated the estimated scroll distance in each direction given velocities on both axes.
Link copied to clipboard
Override this method to provide a particular target view for snapping.
Link copied to clipboard
abstract fun findTargetSnapPosition(layoutManager: RecyclerView.LayoutManager, velocityX: Int, velocityY: Int): Int
Override to provide a particular adapter target position for snapping.
Link copied to clipboard