Package com. devbase. presentation. recyclerview

Defines configuration for RecyclerView purposes

Types

Link copied to clipboard
abstract class DevItemViewHolder<Model>(itemView: View) : RecyclerView.ViewHolder

View Holder for RecyclerView

Link copied to clipboard
abstract class DevRecyclerViewAdapter<Data>(onClickListener: (data: Data) -> Unit? = null, onLongClickListener: (data: Data) -> Unit? = null) : RecyclerView.Adapter<DevItemViewHolder<Data>>

Adapter for RecyclerView

Link copied to clipboard
class RecyclerViewConfiguration<model : Any>(    var layoutManager: RecyclerView.LayoutManager? = null,     var devAdapter: DevRecyclerViewAdapter<model>? = null,     var pagination: Boolean = false,     var loadMoreListener: OnLoadMoreListener? = null,     var onClickListener: (model?) -> Unit? = null,     var ongLongClickListener: (model?) -> Unit? = null)

Class for containing RecyclerView configuration in extension function

Link copied to clipboard
typealias RecyclerViewDeclaration<model> = RecyclerViewConfiguration<model>.() -> Unit

type Alias for builder pattern

Functions

Link copied to clipboard
inline fun <model : Any> RecyclerView.setupPagination(configuration: PaginationDeclaration<model>): DevRecyclerViewPaginationAdapter<model>

Method to configure RecyclerView with Pagination

Link copied to clipboard
inline fun <model : Any> RecyclerView.setupWith(configuration: RecyclerViewDeclaration<model>): DevRecyclerViewAdapter<model>

Method to configure RecyclerView