# RecyclerView.LayoutManager.LayoutPrefetchRegistry

Artifact: [androidx.recyclerview:recyclerview](https://developer.android.com/jetpack/androidx/releases/recyclerview) [View Source](https://cs.android.com/search?q=file:androidx/recyclerview/widget/RecyclerView.java+class:androidx.recyclerview.widget.RecyclerView.LayoutManager.LayoutPrefetchRegistry) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)

*** ** * ** ***


```
public interface RecyclerView.LayoutManager.LayoutPrefetchRegistry
```

<br />

*** ** * ** ***

Interface for LayoutManagers to request items to be prefetched, based on position, with specified distance from viewport, which indicates priority.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.LayoutManager#collectAdjacentPrefetchPositions(int,int,androidx.recyclerview.widget.RecyclerView.State,androidx.recyclerview.widget.RecyclerView.LayoutManager.LayoutPrefetchRegistry)` |   |
| `https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.LayoutManager#collectInitialPrefetchPositions(int,androidx.recyclerview.widget.RecyclerView.LayoutManager.LayoutPrefetchRegistry)` |   |

## Summary

| ### Public methods |
|---|---|
| `abstract void` | `https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.LayoutManager.LayoutPrefetchRegistry#addPosition(int,int)(int layoutPosition, int pixelDistance)` Requests an an item to be prefetched, based on position, with a specified distance, indicating priority. |

## Public methods

### addPosition

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/recyclerview#1.0.0)

```
abstract void addPosition(int layoutPosition, int pixelDistance)
```

Requests an an item to be prefetched, based on position, with a specified distance, indicating priority.

| Parameters |
|---|---|
| `int layoutPosition` | Position of the item to prefetch. |
| `int pixelDistance` | Distance from the current viewport to the bounds of the item, must be non-negative. |