Google은 흑인 공동체를 위한 인종 간 평등을 진전시키기 위해 노력하고 있습니다. Google에서 어떤 노력을 하고 있는지 확인하세요.

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 View?

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