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 | |
---|---|
<init>() Implementation of the |
Public methods | |
---|---|
open IntArray? |
calculateDistanceToFinalSnap(@NonNull layoutManager: RecyclerView.LayoutManager, @NonNull targetView: View) |
open View? |
findSnapView(layoutManager: RecyclerView.LayoutManager!) |
open Int |
findTargetSnapPosition(layoutManager: RecyclerView.LayoutManager!, velocityX: Int, velocityY: Int) |
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?
findSnapView
open fun findSnapView(layoutManager: RecyclerView.LayoutManager!): View?
findTargetSnapPosition
open fun findTargetSnapPosition(
layoutManager: RecyclerView.LayoutManager!,
velocityX: Int,
velocityY: Int
): Int