Dev Item View Holder

abstract class DevItemViewHolder<Model>(itemView: View) : RecyclerView.ViewHolder

View Holder for RecyclerView

Author

Jimly A.

Since

31-May-20.

Parameters

itemView

View of the item

Model

object data of the ViewHolder

Constructors

Link copied to clipboard
fun DevItemViewHolder(itemView: View)

Functions

Link copied to clipboard
abstract fun bind(data: Model? = null)

Method to bind model data with desired view from View Holder

Link copied to clipboard
fun initViewAndAction(    data: Model,     onClickListener: (data: Model) -> Unit? = null,     onLongClickListener: (data: Model) -> Unit? = null)

Method to set click and long click listener, lastly bind data with view

Inheritors

Link copied to clipboard

Sources

Link copied to clipboard