AbstractViewBindingAdapter

abstract class AbstractViewBindingAdapter<T, VH : RecyclerView.ViewHolder, VB : ViewBinding>(viewHolder: (binding: VB) -> VH, bindingInflater: (LayoutInflater, ViewGroup, Boolean) -> VB, areItemsTheSameCallback: (old: T, new: T) -> Boolean? = { _, _ -> null }, areContentsTheSameCallback: (old: T, new: T) -> Boolean? = { _, _ -> null }, onCreateBinding: (holder: VH) -> Unit = {}) : ListAdapter<T, VH>

Takes leverage of not providing that damn layout res id

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

Constructors

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

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, holder: VH, position: Int, itemCount: Int)
Link copied to clipboard
fun bindViewHolder(@NonNull p0: VH, p1: Int)
Link copied to clipboard
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
open fun onBindViewHolder(@NonNull p0: VH, p1: Int, @NonNull p2: MutableList<Any>)
open override fun onBindViewHolder(holder: VH, position: Int)
Link copied to clipboard
Link copied to clipboard
open override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): VH
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
Link copied to clipboard
Link copied to clipboard
open fun onViewRecycled(@NonNull p0: VH)
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?)