Dev Recycler View Pagination Configuration

class DevRecyclerViewPaginationConfiguration<model : Any>(    var layoutManager: RecyclerView.LayoutManager? = null,     var devAdapter: DevRecyclerViewPaginationAdapter<model>? = null,     var onClickListener: (model?) -> Unit? = null,     var ongLongClickListener: (model?) -> Unit? = null)

Class for containing RecyclerView configuration in extension function

Author

Jimly A.

Since

26-Jul-22

Parameters

model

Object model for the RecyclerView

devAdapter

RecyclerView Adapter from codebase

onClickListener

Click Listener for the item

ongLongClickListener

on Long click listener for the item

Constructors

Link copied to clipboard
fun <model : Any> DevRecyclerViewPaginationConfiguration(    layoutManager: RecyclerView.LayoutManager? = null,     devAdapter: DevRecyclerViewPaginationAdapter<model>? = null,     onClickListener: (model?) -> Unit? = null,     ongLongClickListener: (model?) -> Unit? = null)

return RecyclerView Configuration

Functions

Link copied to clipboard
inline fun <viewBinding : ViewBinding> withBinding(crossinline onBind: (model?, viewBinding) -> Unit)

method to configure item Binding

Link copied to clipboard
fun withClick(onClick: (model?) -> Unit)

method to define action when item is clicked

Link copied to clipboard
fun withLayoutManager(layoutManager: RecyclerView.LayoutManager?)

method to configure layout manager

Link copied to clipboard
fun withLongClick(ongLongClick: (model?) -> Unit)

method to define action when item is long clicked

Properties

Link copied to clipboard
var devAdapter: DevRecyclerViewPaginationAdapter<model>? = null
Link copied to clipboard
var layoutManager: RecyclerView.LayoutManager? = null
Link copied to clipboard
var onClickListener: (model?) -> Unit? = null
Link copied to clipboard
var ongLongClickListener: (model?) -> Unit? = null

Sources

Link copied to clipboard