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

PagerSnapHelper

open class PagerSnapHelper : SnapHelper
kotlin.Any
   ↳ androidx.recyclerview.widget.RecyclerView.OnFlingListener
   ↳ androidx.recyclerview.widget.SnapHelper
   ↳ androidx.recyclerview.widget.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 android.view.ViewGroup.LayoutParams#MATCH_PARENT height and width and then attach PagerSnapHelper to the RecyclerView using attachToRecyclerView(RecyclerView).

Summary

Public constructors

Implementation of the SnapHelper supporting pager style 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)

Protected methods
open RecyclerView.SmoothScroller?
createScroller(@NonNull layoutManager: RecyclerView.LayoutManager)

Inherited functions

Public constructors

<init>

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 android.view.ViewGroup.LayoutParams#MATCH_PARENT height and width and then attach PagerSnapHelper to the RecyclerView using attachToRecyclerView(RecyclerView).

Public methods

calculateDistanceToFinalSnap

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

findSnapView

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

findTargetSnapPosition

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

Protected methods

createScroller

@Nullable protected open fun createScroller(@NonNull layoutManager: RecyclerView.LayoutManager): RecyclerView.SmoothScroller?