commons/ui / com.vmadalin.commons.ui.base / BaseListAdapter

BaseListAdapter

abstract class BaseListAdapter<T> : ListAdapter<T, ViewHolder>

Base list adapter to standardize and simplify initialization for this component.

Parameters

itemsSame - Function called to check whether two objects represent the same item.

contentsSame - Function called to check whether two items have the same data.

See Also

ListAdapter

Constructors

<init>

Base list adapter to standardize and simplify initialization for this component.

BaseListAdapter(itemsSame: (T, T) -> Boolean, contentsSame: (T, T) -> Boolean)

Functions

onCreateViewHolder

Called when RecyclerView needs a new RecyclerView.ViewHolder of the given type to represent an item.

abstract fun onCreateViewHolder(parent: ViewGroup, inflater: LayoutInflater, viewType: Int): ViewHolder
open fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder