RecycledViewPool

RecycledViewPool lets you share Views between multiple RecyclerViews.

If you want to recycle views across RecyclerViews, create an instance of RecycledViewPool and use setRecycledViewPool.

RecyclerView automatically creates a pool for itself if you don't provide one.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open fun clear()
Discard all ViewHolders.
Link copied to clipboard
Acquire a ViewHolder of the specified type from the pool, or null if none are present.
Link copied to clipboard
open fun getRecycledViewCount(viewType: Int): Int
Returns the current number of Views held by the RecycledViewPool of the given view type.
Link copied to clipboard
Add a scrap ViewHolder to the pool.
Link copied to clipboard
open fun setMaxRecycledViews(viewType: Int, max: Int)
Sets the maximum number of ViewHolders to hold in the pool before discarding.