AbstractViewBindingHolderAdapter

abstract class AbstractViewBindingHolderAdapter<T, VB : ViewBinding>(bindingInflater: (LayoutInflater, ViewGroup, Boolean) -> VB, areItemsTheSameCallback: (old: T, new: T) -> Boolean? = { _, _ -> null }, areContentsTheSameCallback: (old: T, new: T) -> Boolean? = { _, _ -> null }, onCreateBinding: (holder: AbstractViewBindingHolderAdapter.AbstractViewHolder<VB>) -> Unit = {}) : ListAdapter<T, AbstractViewBindingHolderAdapter.AbstractViewHolder<VB>>

Takes leverage of not providing that damn layout res id

USAGE: class TestViewBindingAdapter : AbstractViewBindingAdapter( ::TestViewHolderShimmer, CustomizableCardViewBinding::inflate )

Constructors

Link copied to clipboard
constructor(bindingInflater: (LayoutInflater, ViewGroup, Boolean) -> VB, areItemsTheSameCallback: (old: T, new: T) -> Boolean? = { _, _ -> null }, areContentsTheSameCallback: (old: T, new: T) -> Boolean? = { _, _ -> null }, onCreateBinding: (holder: AbstractViewBindingHolderAdapter.AbstractViewHolder<VB>) -> Unit = {})

Types

Link copied to clipboard
class AbstractViewHolder<VB : ViewBinding>(val binding: VB) : RecyclerView.ViewHolder

Properties

Link copied to clipboard
var forItemClickListener: (position: Int, item: T, view: View) -> Unit?
Link copied to clipboard
var onLongClickListener: (position: Int, item: T, view: View) -> Unit?

Functions

Link copied to clipboard
abstract fun bindItems(item: T, position: Int, itemCount: Int, binding: VB, context: Context)
Link copied to clipboard
Link copied to clipboard
open override fun getItemCount(): Int
Link copied to clipboard
open fun getItemId(p0: Int): Long
Link copied to clipboard
open fun getItemViewType(p0: Int): Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun notifyItemMoved(p0: Int, p1: Int)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun RecyclerView.Adapter<*>.onItemRangeChanged(action: (positionStart: Int, itemCount: Int) -> Unit = { _, _ -> }): RecyclerView.AdapterDataObserver
fun RecyclerView.Adapter<*>.onItemRangeChanged(action: (positionStart: Int, itemCount: Int, payload: Any?) -> Unit = { _, _, _ -> }): RecyclerView.AdapterDataObserver
Link copied to clipboard
fun RecyclerView.Adapter<*>.onItemRangeInserted(action: (positionStart: Int, itemCount: Int) -> Unit = { _, _ -> }): RecyclerView.AdapterDataObserver
Link copied to clipboard
fun RecyclerView.Adapter<*>.onItemRangeMoved(action: (fromPosition: Int, toPosition: Int, itemCount: Int) -> Unit = { _, _, _ -> }): RecyclerView.AdapterDataObserver
Link copied to clipboard
fun RecyclerView.Adapter<*>.onItemRangeRemoved(action: (positionStart: Int, itemCount: Int) -> Unit = { _, _ -> }): RecyclerView.AdapterDataObserver
Link copied to clipboard
open fun setHasStableIds(p0: Boolean)
Link copied to clipboard
open fun submitList(@Nullable p0: MutableList<T>?)
open fun submitList(@Nullable p0: MutableList<T>?, @Nullable p1: Runnable?)