init View And Action

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

Parameters

data

data model

onClickListener

Action when item clicked, nullable

onLongClickListener

Action when item clicked for long, nullable

Sources

Link copied to clipboard