collectAdjacentPrefetchPositions
open fun collectAdjacentPrefetchPositions(dx: Int, dy: Int, state: RecyclerView.State, layoutPrefetchRegistry: RecyclerView.LayoutManager.LayoutPrefetchRegistry)(source)
Gather all positions from the LayoutManager to be prefetched, given specified momentum.
If item prefetch is enabled, this method is called in between traversals to gather which positions the LayoutManager will soon need, given upcoming movement in subsequent traversals.
The LayoutManager should call addPosition for each item to be prepared, and these positions will have their ViewHolders created and bound, if there is sufficient time available, in advance of being needed by a scroll or layout.
Parameters
dx
X movement component.
dy
Y movement component.
state
State of RecyclerView
layoutPrefetchRegistry
PrefetchRegistry to add prefetch entries into.