-
- All Implemented Interfaces:
public final class AnyPagingDataAdapter extends PagingDataAdapter<Any, RecyclerView.ViewHolder>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classAnyPagingDataAdapter.Companion
-
Field Summary
Fields Modifier and Type Field Description private final Flow<CombinedLoadStates>loadStateFlow
-
Constructor Summary
Constructors Constructor Description AnyPagingDataAdapter(Presenter presenter, DiffCallback<Object> diffCallback, CoroutineDispatcher mainDispatcher, CoroutineDispatcher workerDispatcher)AnyPagingDataAdapter(PresenterSelector presenterSelector, DiffCallback<Object> diffCallback, CoroutineDispatcher mainDispatcher, CoroutineDispatcher workerDispatcher)AnyPagingDataAdapter(DiffCallback<Object> diffCallback, CoroutineDispatcher mainDispatcher, CoroutineDispatcher workerDispatcher)
-
Method Summary
Modifier and Type Method Description final Flow<CombinedLoadStates>getLoadStateFlow()final Integersize()Returns the number of items in the adapter. final Objectget(Integer position)IntegergetItemViewType(Integer position)final PresentergetPresenter(Object item)RecyclerView.ViewHolderonCreateViewHolder(ViewGroup parent, Integer viewType)UnitonBindViewHolder(RecyclerView.ViewHolder holder, Integer position)UnitonViewRecycled(RecyclerView.ViewHolder holder)UnitonViewAttachedToWindow(RecyclerView.ViewHolder holder)UnitonViewDetachedFromWindow(RecyclerView.ViewHolder holder)final ConcatAdapterwithLoadStateHeader(Presenter headerPresenter)Create a ConcatAdapter with the provided AnyLoadStateAdapters displaying the LoadType.PREPEND as a list item at the end of the presented list. final ConcatAdapterwithLoadStateHeader(PresenterSelector headerPresenter)Create a ConcatAdapter with the provided AnyLoadStateAdapters displaying the LoadType.PREPEND as a list item at the end of the presented list. final ConcatAdapterwithLoadStateFooter(Presenter footerPresenter)Create a ConcatAdapter with the provided AnyLoadStateAdapters displaying the LoadType.APPEND as a list item at the start of the presented list. final ConcatAdapterwithLoadStateFooter(PresenterSelector footerPresenter)Create a ConcatAdapter with the provided AnyLoadStateAdapters displaying the LoadType.APPEND as a list item at the start of the presented list. final ConcatAdapterwithLoadStateHeaderAndFooter(Presenter headerPresenter, Presenter footerPresenter)Create a ConcatAdapter with the provided AnyLoadStateAdapters displaying the LoadType.PREPEND and LoadType.APPENDs as list items at the start and end respectively. final ConcatAdapterwithLoadStateHeaderAndFooter(PresenterSelector headerPresenter, PresenterSelector footerPresenter)Create a ConcatAdapter with the provided AnyLoadStateAdapters displaying the LoadType.PREPEND and LoadType.APPENDs as list items at the start and end respectively. -
Methods inherited from class androidx.paging.PagingDataAdapter
bindViewHolder, canRestoreState, createViewHolder, findRelativeAdapterPositionIn, getStateRestorationPolicy, hasObservers, hasStableIds, notifyDataSetChanged, notifyItemChanged, notifyItemChanged, notifyItemInserted, notifyItemMoved, notifyItemRangeChanged, notifyItemRangeChanged, notifyItemRangeInserted, notifyItemRangeRemoved, notifyItemRemoved, onAttachedToRecyclerView, onBindViewHolder, onDetachedFromRecyclerView, onFailedToRecycleView, registerAdapterDataObserver, unregisterAdapterDataObserver -
Methods inherited from class de.pfaffenrodt.adapter.AnyPagingDataAdapter
addLoadStateListener, getItemCount, getItemId, peek, refresh, removeLoadStateListener, retry, setHasStableIds, setStateRestorationPolicy, snapshot, submitData, submitData, withLoadStateFooter, withLoadStateHeader, withLoadStateHeaderAndFooter -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
AnyPagingDataAdapter
AnyPagingDataAdapter(Presenter presenter, DiffCallback<Object> diffCallback, CoroutineDispatcher mainDispatcher, CoroutineDispatcher workerDispatcher)
-
AnyPagingDataAdapter
AnyPagingDataAdapter(PresenterSelector presenterSelector, DiffCallback<Object> diffCallback, CoroutineDispatcher mainDispatcher, CoroutineDispatcher workerDispatcher)
-
AnyPagingDataAdapter
AnyPagingDataAdapter(DiffCallback<Object> diffCallback, CoroutineDispatcher mainDispatcher, CoroutineDispatcher workerDispatcher)
-
-
Method Detail
-
getLoadStateFlow
final Flow<CombinedLoadStates> getLoadStateFlow()
-
getItemViewType
Integer getItemViewType(Integer position)
-
getPresenter
final Presenter getPresenter(Object item)
-
onCreateViewHolder
RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, Integer viewType)
-
onBindViewHolder
Unit onBindViewHolder(RecyclerView.ViewHolder holder, Integer position)
-
onViewRecycled
Unit onViewRecycled(RecyclerView.ViewHolder holder)
-
onViewAttachedToWindow
Unit onViewAttachedToWindow(RecyclerView.ViewHolder holder)
-
onViewDetachedFromWindow
Unit onViewDetachedFromWindow(RecyclerView.ViewHolder holder)
-
withLoadStateHeader
final ConcatAdapter withLoadStateHeader(Presenter headerPresenter)
Create a ConcatAdapter with the provided AnyLoadStateAdapters displaying the LoadType.PREPEND as a list item at the end of the presented list.
-
withLoadStateHeader
final ConcatAdapter withLoadStateHeader(PresenterSelector headerPresenter)
Create a ConcatAdapter with the provided AnyLoadStateAdapters displaying the LoadType.PREPEND as a list item at the end of the presented list.
-
withLoadStateFooter
final ConcatAdapter withLoadStateFooter(Presenter footerPresenter)
Create a ConcatAdapter with the provided AnyLoadStateAdapters displaying the LoadType.APPEND as a list item at the start of the presented list.
-
withLoadStateFooter
final ConcatAdapter withLoadStateFooter(PresenterSelector footerPresenter)
Create a ConcatAdapter with the provided AnyLoadStateAdapters displaying the LoadType.APPEND as a list item at the start of the presented list.
-
withLoadStateHeaderAndFooter
final ConcatAdapter withLoadStateHeaderAndFooter(Presenter headerPresenter, Presenter footerPresenter)
Create a ConcatAdapter with the provided AnyLoadStateAdapters displaying the LoadType.PREPEND and LoadType.APPENDs as list items at the start and end respectively.
-
withLoadStateHeaderAndFooter
final ConcatAdapter withLoadStateHeaderAndFooter(PresenterSelector headerPresenter, PresenterSelector footerPresenter)
Create a ConcatAdapter with the provided AnyLoadStateAdapters displaying the LoadType.PREPEND and LoadType.APPENDs as list items at the start and end respectively.
-
-
-
-