LinearSnapHelper

open class LinearSnapHelper : SnapHelper
kotlin.Any
   ↳ androidx.recyclerview.widget.RecyclerView.OnFlingListener
   ↳ androidx.recyclerview.widget.SnapHelper
   ↳ androidx.recyclerview.widget.LinearSnapHelper

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

The implementation will snap the center of the target child view to the center of the attached RecyclerView. If you intend to change this behavior then override SnapHelper#calculateDistanceToFinalSnap.

Summary

Public constructors

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

Public methods
open IntArray?
calculateDistanceToFinalSnap(@NonNull layoutManager: RecyclerView.LayoutManager, @NonNull targetView: View)

open Int
findTargetSnapPosition(layoutManager: RecyclerView.LayoutManager!, velocityX: Int, velocityY: Int)

open View?

Inherited functions

Public constructors

<init>

LinearSnapHelper()

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

The implementation will snap the center of the target child view to the center of the attached RecyclerView. If you intend to change this behavior then override SnapHelper#calculateDistanceToFinalSnap.

Public methods

calculateDistanceToFinalSnap

open fun calculateDistanceToFinalSnap(@NonNull layoutManager: RecyclerView.LayoutManager, @NonNull targetView: View): IntArray?

findTargetSnapPosition

open fun findTargetSnapPosition(layoutManager: RecyclerView.LayoutManager!, velocityX: Int, velocityY: Int): Int

findSnapView

open fun findSnapView(layoutManager: RecyclerView.LayoutManager!): View?