RecyclerViewManager

class RecyclerViewManager<VH : RecyclerView.ViewHolder, T>(val adapter: RecyclerView.Adapter<VH>, itemComparator: ItemComparator<T>, itemContentComparator: ItemContentComparator<T>)

Utility class to simplify recycler view notifications when content changes. This class detects changes between provided lists of data and notifies the adapter accordingly so that proper animations are drawn to add, remove or move items.

Parameters

VH

type of view holder used by the adapter.

T

type of data held by the adapter.

Constructors

Link copied to clipboard
constructor(adapter: RecyclerView.Adapter<VH>, itemComparator: ItemComparator<T>, itemContentComparator: ItemContentComparator<T>)

Properties

Link copied to clipboard

adapter holding the data.

Link copied to clipboard
val detector: SequentialListItemChangeDetector<T>

Detector to determine changes between lists of data.

Functions

Link copied to clipboard
fun notifyChanges(oldItems: List<T>, newItems: List<T>)

Notifies the adapter of changes between old and new lists of data.