-
- All Implemented Interfaces:
-
com.airbnb.epoxy.stickyheader.StickyHeaderCallbacks
public abstract class BaseEpoxyAdapter extends RecyclerView.Adapter<EpoxyViewHolder> implements StickyHeaderCallbacks
-
-
Field Summary
Fields Modifier and Type Field Description private intspanCountprivate final GridLayoutManager.SpanSizeLookupspanSizeLookup
-
Constructor Summary
Constructors Constructor Description BaseEpoxyAdapter()
-
Method Summary
Modifier and Type Method Description intgetSpanCount()voidsetSpanCount(int spanCount)If you are using a grid layout manager you must call this to set the span count of the grid.This span count will be passed on to the models so models can choose what span count to be. GridLayoutManager.SpanSizeLookupgetSpanSizeLookup()For use with a grid layout manager - use this to get the SpanSizeLookup for models inthis adapter. intgetItemCount()booleanisEmpty()longgetItemId(int position)intgetItemViewType(int position)EpoxyViewHolderonCreateViewHolder(ViewGroup parent, int viewType)voidonBindViewHolder(EpoxyViewHolder holder, int position)voidonBindViewHolder(EpoxyViewHolder holder, int position, List<Object> payloads)voidonViewRecycled(EpoxyViewHolder holder)voidonDetachedFromRecyclerView(@NonNull() RecyclerView recyclerView)booleanonFailedToRecycleView(EpoxyViewHolder holder)voidonViewAttachedToWindow(EpoxyViewHolder holder)voidonViewDetachedFromWindow(EpoxyViewHolder holder)voidonSaveInstanceState(Bundle outState)voidonRestoreInstanceState(@Nullable() Bundle inState)booleanisMultiSpan()voidsetupStickyHeaderView(@NotNull() View stickyHeader)Optional callback to setup the sticky view,by default it doesn't do anything. voidteardownStickyHeaderView(@NotNull() View stickyHeader)Optional callback to perform tear down operation on thesticky view, by default it doesn't do anything. booleanisStickyHeader(int position)Called to check if the item at the position is a sticky item,by default returns false. -
Methods inherited from class androidx.recyclerview.widget.RecyclerView.Adapter
bindViewHolder, createViewHolder, findRelativeAdapterPositionIn, getItemCount, getItemId, getItemViewType, getStateRestorationPolicy, hasObservers, hasStableIds, notifyDataSetChanged, notifyItemChanged, notifyItemInserted, notifyItemMoved, notifyItemRangeChanged, notifyItemRangeInserted, notifyItemRangeRemoved, notifyItemRemoved, onAttachedToRecyclerView, onBindViewHolder, onCreateViewHolder, onDetachedFromRecyclerView, onFailedToRecycleView, onViewAttachedToWindow, onViewDetachedFromWindow, onViewRecycled, registerAdapterDataObserver, setHasStableIds, setStateRestorationPolicy, unregisterAdapterDataObserver -
Methods inherited from class com.airbnb.epoxy.stickyheader.StickyHeaderCallbacks
isStickyHeader, setupStickyHeaderView, teardownStickyHeaderView -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getSpanCount
int getSpanCount()
-
setSpanCount
void setSpanCount(int spanCount)
If you are using a grid layout manager you must call this to set the span count of the grid.This span count will be passed on to the models so models can choose what span count to be.
-
getSpanSizeLookup
GridLayoutManager.SpanSizeLookup getSpanSizeLookup()
For use with a grid layout manager - use this to get the SpanSizeLookup for models inthis adapter. This will delegate span look up calls to each model's . Make sure to also call setSpanCount sothe span count is correct.
-
getItemCount
int getItemCount()
-
isEmpty
boolean isEmpty()
-
getItemId
long getItemId(int position)
-
getItemViewType
int getItemViewType(int position)
-
onCreateViewHolder
EpoxyViewHolder onCreateViewHolder(ViewGroup parent, int viewType)
-
onBindViewHolder
void onBindViewHolder(EpoxyViewHolder holder, int position)
-
onBindViewHolder
void onBindViewHolder(EpoxyViewHolder holder, int position, List<Object> payloads)
-
onViewRecycled
void onViewRecycled(EpoxyViewHolder holder)
-
onDetachedFromRecyclerView
@CallSuper() void onDetachedFromRecyclerView(@NonNull() RecyclerView recyclerView)
-
onFailedToRecycleView
@CallSuper() boolean onFailedToRecycleView(EpoxyViewHolder holder)
-
onViewAttachedToWindow
@CallSuper() void onViewAttachedToWindow(EpoxyViewHolder holder)
-
onViewDetachedFromWindow
@CallSuper() void onViewDetachedFromWindow(EpoxyViewHolder holder)
-
onSaveInstanceState
void onSaveInstanceState(Bundle outState)
-
onRestoreInstanceState
void onRestoreInstanceState(@Nullable() Bundle inState)
-
isMultiSpan
boolean isMultiSpan()
-
setupStickyHeaderView
void setupStickyHeaderView(@NotNull() View stickyHeader)
Optional callback to setup the sticky view,by default it doesn't do anything.
The sub-classes should override the function if they areusing sticky header feature.
-
teardownStickyHeaderView
void teardownStickyHeaderView(@NotNull() View stickyHeader)
Optional callback to perform tear down operation on thesticky view, by default it doesn't do anything.
The sub-classes should override the function if they areusing sticky header feature.
-
isStickyHeader
boolean isStickyHeader(int position)
Called to check if the item at the position is a sticky item,by default returns false.
The sub-classes should override the function if they areusing sticky header feature.
-
-
-
-