ViewCacheExtension
ViewCacheExtension is a helper class to provide an additional layer of view caching that can be controlled by the developer.
When getViewForPosition is called, Recycler checks attached scrap and first level cache to find a matching View. If it cannot find a suitable View, Recycler will call the getViewForPositionAndType before checking RecycledViewPool.
Note that, Recycler never sends Views to this method to be cached. It is developers responsibility to decide whether they want to keep their Views in this custom cache or let the default recycling policy handle it.
Functions
Link copied to clipboard
abstract fun getViewForPositionAndType(@NonNull recycler: RecyclerView.Recycler, position: Int, type: Int): View
Returns a View that can be binded to the given Adapter position.