RecyclerItem

abstract class RecyclerItem(val id: Long) : IRecyclerItem

A wrapper for items that can be displayed inside the recycler view

Since

v1.3.0

See also

Inheritors

Constructors

Link copied to clipboard
constructor(id: Long)

Properties

Link copied to clipboard
open override val decorator: ISelectionDecorator

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

Link copied to clipboard
open override val id: Long

id of the item view

Link copied to clipboard
open override val supportsSelectionMode: Boolean = false

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