-
- All Implemented Interfaces:
-
androidx.lifecycle.LifecycleObserver
public abstract class FirebaseRecyclerPagingAdapter<T, VH extends RecyclerView.ViewHolder> extends PagingDataAdapter<DataSnapshot, VH> implements LifecycleObserver
Paginated RecyclerView Adapter for a Firebase Realtime Database query. Configured with DatabasePagingOptions.
-
-
Constructor Summary
Constructors Constructor Description FirebaseRecyclerPagingAdapter(DatabasePagingOptions<T> options)Construct a new FirestorePagingAdapter from the given DatabasePagingOptions.
-
Method Summary
Modifier and Type Method Description voidinit()Initializes Snapshots and LiveData voidupdateOptions(@NonNull() DatabasePagingOptions<T> options)Re-initialize the Adapter with a new set of options. voidstartListening()Start listening to paging / scrolling events and populating adapter data. voidstopListening()Unsubscribe from paging / scrolling events, no more data will be populated, but the existingdata will remain. voidonBindViewHolder(@NonNull() VH viewHolder, int position)DatabaseReferencegetRef(int position)-
Methods inherited from class androidx.paging.PagingDataAdapter
addLoadStateListener, getItemCount, getItemId, getLoadStateFlow, peek, refresh, removeLoadStateListener, retry, setHasStableIds, setStateRestorationPolicy, snapshot, submitData, submitData, withLoadStateFooter, withLoadStateHeader, withLoadStateHeaderAndFooter -
Methods inherited from class androidx.recyclerview.widget.RecyclerView.Adapter
bindViewHolder, createViewHolder, findRelativeAdapterPositionIn, getItemViewType, getStateRestorationPolicy, hasObservers, hasStableIds, notifyDataSetChanged, notifyItemChanged, notifyItemInserted, notifyItemMoved, notifyItemRangeChanged, notifyItemRangeInserted, notifyItemRangeRemoved, notifyItemRemoved, onAttachedToRecyclerView, onBindViewHolder, onCreateViewHolder, onDetachedFromRecyclerView, onFailedToRecycleView, onViewAttachedToWindow, onViewDetachedFromWindow, onViewRecycled, registerAdapterDataObserver, unregisterAdapterDataObserver -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
FirebaseRecyclerPagingAdapter
FirebaseRecyclerPagingAdapter(DatabasePagingOptions<T> options)
Construct a new FirestorePagingAdapter from the given DatabasePagingOptions.
-
-
Method Detail
-
init
void init()
Initializes Snapshots and LiveData
-
updateOptions
void updateOptions(@NonNull() DatabasePagingOptions<T> options)
Re-initialize the Adapter with a new set of options. Can be used to change the query withoutre-constructing the entire adapter.
-
startListening
void startListening()
Start listening to paging / scrolling events and populating adapter data.
-
stopListening
void stopListening()
Unsubscribe from paging / scrolling events, no more data will be populated, but the existingdata will remain.
-
onBindViewHolder
void onBindViewHolder(@NonNull() VH viewHolder, int position)
-
-
-
-