Package-level declarations

Top-level Kotlin extensions/utils for AndroidX RecyclerView.

Inherited properties

Link copied to clipboard

Informs the recycler whether this item can be recycled. Views which are not recyclable will not be reused for other items until canRecycle is later set to true.

Link copied to clipboard

Whether to avoid invalidating the whole layout when its adapter contents change.

Link copied to clipboard

Indicates whether each item in the data set can be represented with a unique identifier of type Long.

Functions

Link copied to clipboard
inline fun callback(crossinline getOldListSize: () -> Int, crossinline getNewListSize: () -> Int, crossinline areItemsTheSame: (oldItemPosition: Int, newItemPosition: Int) -> Boolean, crossinline areContentsTheSame: (oldItemPosition: Int, newItemPosition: Int) -> Boolean, crossinline getChangePayload: (oldItemPosition: Int, newItemPosition: Int) -> Any? = { _, _ -> null }): DiffUtil.Callback

A Callback class used by DiffUtil while calculating the diff between two lists.

Link copied to clipboard
inline fun <T : Any> itemCallback(crossinline areItemsTheSame: (oldItem: T, newItem: T) -> Boolean, crossinline areContentsTheSame: (oldItem: T, newItem: T) -> Boolean, crossinline getChangePayload: (oldItem: T, newItem: T) -> Any? = { _, _ -> null }): DiffUtil.ItemCallback<T>

Callback for calculating the diff between two non-null items in a list.

Inherited functions

Link copied to clipboard

Calls the block on the RecyclerView.ViewHolder receiver with canRecycle temporarily set to false, and when block is done executing canRecycle will be set back to true.