SupportPagedListAdapter

abstract class SupportPagedListAdapter<T : Any>(differCallback: DiffUtil.ItemCallback<T>, supportsStableIds: Boolean = false) : PagedListAdapter<T, SupportViewHolder> , SupportAdapter<T>

Core implementation for handling complex logic for androidx.paging.PagedListAdapter and androidx.recyclerview.widget.RecyclerView.ViewHolder binding logic

Since

v1.2.0

Parameters

differCallback

Callback for calculating the diff between two non-null items in a list.

supportsStableIds

Sets PagedListAdapter.setHasStableIds which is defaulted to true

See also

Constructors

Link copied to clipboard
constructor(differCallback: DiffUtil.ItemCallback<T>, supportsStableIds: Boolean = false)

Properties

Link copied to clipboard
open override val clickableFlow: MutableStateFlow<ClickableItem>
Link copied to clipboard
Link copied to clipboard
open val currentList: PagedList<T>?
Link copied to clipboard
Link copied to clipboard
open override var isUsingConcatAdapter: Boolean

Internal use only indicator for checking against the use of a concat adapter for headers and footers, which is in turn used to figure out how to get the view holder id

Link copied to clipboard
open override var lastAnimatedPosition: Int
Link copied to clipboard
abstract val mapper: (T) -> IRecyclerItem
Link copied to clipboard
abstract val resources: Resources
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open fun addLoadStateListener(listener: (LoadType, LoadState) -> Unit)
Link copied to clipboard
open fun animateViewHolder(holder: SupportViewHolder?, position: Int)
Link copied to clipboard
Link copied to clipboard
open fun bindViewHolderByType(holder: SupportViewHolder, position: Int, payloads: List<Any>)
Link copied to clipboard
abstract fun createDefaultViewHolder(parent: ViewGroup, viewType: Int, layoutInflater: LayoutInflater): SupportViewHolder
Link copied to clipboard
Link copied to clipboard
open override fun getItemCount(): Int
Link copied to clipboard
open override fun getItemId(position: Int): Long

Return the stable ID for the item at position. If hasStableIds would return false this method should return RecyclerView.NO_ID.

Link copied to clipboard
open override fun getItemViewType(position: Int): Int

Return the view type of the item at position for the purposes of view recycling.

Link copied to clipboard
open fun getSpanSizeForItemAt(position: Int, spanCount: Int?): Int?
Link copied to clipboard
open fun getStableIdFor(item: T?): Long
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun ISupportAdapter<*>.isEmpty(emptyCount: Int = 0): Boolean

Check if ISupportAdapter ->PagedListAdapter contains any list items

Link copied to clipboard
Link copied to clipboard
open override fun notifyDataSetNeedsRefreshing()

Informs view adapter of changes related to it's view holder

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
open override fun onAttachedToRecyclerView(recyclerView: RecyclerView)

Called by RecyclerView when it starts observing this Adapter.

Link copied to clipboard
open override fun onBindViewHolder(holder: SupportViewHolder, position: Int)
open override fun onBindViewHolder(holder: SupportViewHolder, position: Int, payloads: MutableList<Any>)

Calls the the recycler view holder to perform view binding, and selection mode decorations are set up

Link copied to clipboard
open override fun onCreate(owner: LifecycleOwner)
Link copied to clipboard
open override fun onCreateViewHolder(parent: ViewGroup, @LayoutRes viewType: Int): SupportViewHolder

Overridden implementation createDefaultViewHolder calls to resolve the view holder type

Link copied to clipboard
open fun onCurrentListChanged(currentList: PagedList<T>?)
open fun onCurrentListChanged(previousList: PagedList<T>?, currentList: PagedList<T>?)
Link copied to clipboard
open override fun onDestroy(owner: LifecycleOwner)
Link copied to clipboard
open override fun onPause(owner: LifecycleOwner)
Link copied to clipboard
open override fun onResume(owner: LifecycleOwner)
Link copied to clipboard
open override fun onStart(owner: LifecycleOwner)
Link copied to clipboard
open override fun onStop(owner: LifecycleOwner)
Link copied to clipboard
open override fun onViewAttachedToWindow(holder: SupportViewHolder)

Called when a view created by this adapter has been attached to a window.

Link copied to clipboard
open override fun onViewDetachedFromWindow(holder: SupportViewHolder)

Called when a view created by this adapter has been detached from its window.

Link copied to clipboard
open override fun onViewRecycled(holder: SupportViewHolder)

Calls the the recycler view holder impl to perform view recycling

Link copied to clipboard
Link copied to clipboard
open override fun requireItem(position: Int): T

Returns the non-nullable item for this adapter

Link copied to clipboard
open fun setHasStableIds(p0: Boolean)
Link copied to clipboard
open fun setLayoutSpanSize(layoutManager: GridLayoutManager)
Link copied to clipboard
open fun setLoadState(state: LoadState)
Link copied to clipboard
open fun submitList(pagedList: PagedList<T>?)
open fun submitList(pagedList: PagedList<T>?, commitCallback: Runnable?)