public abstract class SectionedRecyclerViewAdapter<VH extends SectionedViewHolder>
extends <any>
| Modifier and Type | Field and Description |
|---|---|
protected static int |
VIEW_TYPE_FOOTER |
protected static int |
VIEW_TYPE_HEADER |
protected static int |
VIEW_TYPE_ITEM |
| Constructor and Description |
|---|
SectionedRecyclerViewAdapter() |
| Modifier and Type | Method and Description |
|---|---|
void |
collapseAllSections() |
void |
collapseSection(int section) |
void |
expandAllSections() |
void |
expandSection(int section) |
int |
getAbsolutePosition(int sectionIndex,
int relativeIndex)
Converts a relative position (index inside of a section) to an absolute position (index out of
all items and headers).
|
int |
getAbsolutePosition(ItemCoord relativePosition)
Converts a relative position (index inside of a section) to an absolute position (index out of
all items and headers).
|
long |
getFooterId(int section) |
int |
getFooterViewType(int section) |
long |
getHeaderId(int section) |
int |
getHeaderViewType(int section) |
int |
getItemCount() |
abstract int |
getItemCount(int section) |
long |
getItemId(int position)
Deprecated.
|
long |
getItemId(int section,
int position) |
int |
getItemViewType(int position)
Deprecated.
|
int |
getItemViewType(int section,
int relativePosition,
int absolutePosition) |
ItemCoord |
getRelativePosition(int absolutePosition)
Converts an absolute position to a relative position and section.
|
protected int |
getRowSpan(int fullSpanSize,
int section,
int relativePosition,
int absolutePosition) |
abstract int |
getSectionCount() |
int |
getSectionFooterIndex(int section) |
int |
getSectionHeaderIndex(int section) |
boolean |
isFooter(int position) |
boolean |
isHeader(int position) |
boolean |
isSectionExpanded(int section) |
void |
notifySectionChanged(int section) |
abstract void |
onBindFooterViewHolder(VH holder,
int section) |
abstract void |
onBindHeaderViewHolder(VH holder,
int section,
boolean expanded) |
void |
onBindViewHolder(VH holder,
int position)
Deprecated.
|
abstract void |
onBindViewHolder(VH holder,
int section,
int relativePosition,
int absolutePosition) |
void |
onBindViewHolder(VH holder,
int position,
java.util.List<java.lang.Object> payloads)
Deprecated.
|
void |
setLayoutManager(GridLayoutManager lm) |
void |
shouldShowFooters(boolean show)
Toggle whether or not section footers are shown at the bottom of each section.
|
void |
shouldShowHeadersForEmptySections(boolean show)
Toggle whether or not section headers are shown when a section has no items.
|
boolean |
showFooters() |
boolean |
showHeadersForEmptySections() |
void |
toggleSectionExpanded(int section) |
protected static final int VIEW_TYPE_FOOTER
protected static final int VIEW_TYPE_HEADER
protected static final int VIEW_TYPE_ITEM
public void notifySectionChanged(int section)
public void expandSection(int section)
public void collapseSection(int section)
public void expandAllSections()
public void collapseAllSections()
public void toggleSectionExpanded(int section)
public abstract int getSectionCount()
public abstract int getItemCount(int section)
public abstract void onBindHeaderViewHolder(VH holder, int section, boolean expanded)
public abstract void onBindFooterViewHolder(VH holder, int section)
public abstract void onBindViewHolder(VH holder, int section, int relativePosition, int absolutePosition)
public final boolean isHeader(int position)
public final boolean isFooter(int position)
public final boolean isSectionExpanded(int section)
public final int getSectionHeaderIndex(int section)
public final int getSectionFooterIndex(int section)
public final void shouldShowHeadersForEmptySections(boolean show)
public final void shouldShowFooters(boolean show)
public final void setLayoutManager(GridLayoutManager lm)
protected int getRowSpan(int fullSpanSize,
int section,
int relativePosition,
int absolutePosition)
public ItemCoord getRelativePosition(int absolutePosition)
public int getAbsolutePosition(int sectionIndex,
int relativeIndex)
public int getAbsolutePosition(ItemCoord relativePosition)
public final int getItemCount()
public final boolean showHeadersForEmptySections()
public boolean showFooters()
@Deprecated public long getItemId(int position)
public long getHeaderId(int section)
public long getFooterId(int section)
public long getItemId(int section,
int position)
@Deprecated public final int getItemViewType(int position)
public int getHeaderViewType(int section)
public int getFooterViewType(int section)
public int getItemViewType(int section,
int relativePosition,
int absolutePosition)
@Deprecated public final void onBindViewHolder(VH holder, int position)
@Deprecated public final void onBindViewHolder(VH holder, int position, java.util.List<java.lang.Object> payloads)