IRecyclerItem

Contract for recycler item

Since

v1.3.0

See also

Inheritors

Properties

Link copied to clipboard

Decorator that can be used to style this item when it is selected or unselected

Link copied to clipboard
abstract val id: Long

id of the item view

Link copied to clipboard

If selection mode can be used, this will allow automatic styling of elements based on selection state when the view item/s are drawn

Functions

Link copied to clipboard
abstract fun bind(view: View, position: Int, payloads: List<Any>, stateFlow: MutableStateFlow<ClickableItem>, selectionMode: ISupportSelectionMode<Long>?)

Called when the view needs to be setup, this could be to set click listeners, assign text, load images, e.t.c

Link copied to clipboard
abstract fun getSpanSize(spanCount: Int, position: Int, resources: Resources): Int

Provides a preferred span size for the item

Link copied to clipboard
abstract fun unbind(view: View)

Called when the view needs to be recycled for reuse, clear any held references to objects, stop any asynchronous work, e.t.c