public class SectionAdapter
extends java.lang.Object
Section in the SectionedRecyclerViewAdapter.
It provides helper methods for:
Section's items in the SectionedRecyclerViewAdapterSectionedRecyclerViewAdapter in this SectionSectionedRecyclerViewAdapter of item changes in this Section| Modifier and Type | Method and Description |
|---|---|
int |
getFooterPosition()
Helper method that returns the position of footer in the adapter.
|
int |
getHeaderPosition()
Helper method that returns the position of header in the adapter.
|
int |
getPositionInAdapter(int position)
Helper method that receives position in relation to the section, and returns the position in
the adapter.
|
int |
getPositionInSection(int position)
Return the item position in the section.
|
int |
getSectionPosition()
Return the section position in the adapter.
|
void |
notifyAllItemsChanged()
Helper method that receives position in relation to the section, calculates the relative
position in the adapter and calls
RecyclerView.Adapter.notifyItemRangeChanged(int, int). |
void |
notifyAllItemsChanged(java.lang.Object payload)
Helper method that receives position in relation to the section, calculates the relative
position in the adapter and calls
RecyclerView.Adapter.notifyItemRangeChanged(int, int). |
void |
notifyAllItemsInserted()
Helper method that calculates the relative position of all items of this section in the
adapter and calls
RecyclerView.Adapter.notifyItemRangeInserted(int, int). |
void |
notifyFooterChanged()
Helper method that calculates the relative footer position in the adapter and calls
RecyclerView.Adapter.notifyItemChanged(int). |
void |
notifyFooterChanged(java.lang.Object payload)
Helper method that calculates the relative footer position in the adapter and calls
RecyclerView.Adapter.notifyItemChanged(int). |
void |
notifyFooterInserted()
Helper method that calls
RecyclerView.Adapter.notifyItemInserted(int) with the position of the section's
footer in the adapter. |
void |
notifyFooterRemoved()
Helper method that calls
RecyclerView.Adapter.notifyItemRemoved(int) with the position of the section's
footer in the adapter. |
void |
notifyHeaderChanged()
Helper method that calculates the relative header position in the adapter and calls
RecyclerView.Adapter.notifyItemChanged(int). |
void |
notifyHeaderChanged(java.lang.Object payload)
Helper method that calculates the relative header position in the adapter and calls
RecyclerView.Adapter.notifyItemChanged(int). |
void |
notifyHeaderInserted()
Helper method that calls
RecyclerView.Adapter.notifyItemInserted(int) with the position of the section's
header in the adapter. |
void |
notifyHeaderRemoved()
Helper method that calls
RecyclerView.Adapter.notifyItemRemoved(int) with the position of the section's
header in the adapter. |
void |
notifyItemChanged(int position)
Helper method that receives position in relation to the section, calculates the relative
position in the adapter and calls
RecyclerView.Adapter.notifyItemChanged(int). |
void |
notifyItemChanged(int position,
java.lang.Object payload)
Helper method that receives position in relation to the section, calculates the relative
position in the adapter and calls
RecyclerView.Adapter.notifyItemChanged(int). |
void |
notifyItemInserted(int position)
Helper method that receives position in relation to the section, calculates the relative
position in the adapter and calls
RecyclerView.Adapter.notifyItemInserted(int). |
void |
notifyItemMoved(int fromPosition,
int toPosition)
Helper method that receives position in relation to the section, calculates the relative
position in the adapter and calls
RecyclerView.Adapter.notifyItemMoved(int, int). |
void |
notifyItemRangeChanged(int positionStart,
int itemCount)
Helper method that receives position in relation to the section, calculates the relative
position in the adapter and calls
RecyclerView.Adapter.notifyItemRangeChanged(int, int). |
void |
notifyItemRangeChanged(int positionStart,
int itemCount,
java.lang.Object payload)
Helper method that receives position in relation to the section, calculates the relative
position in the adapter and calls
RecyclerView.Adapter.notifyItemRangeChanged(int, int). |
void |
notifyItemRangeInserted(int positionStart,
int itemCount)
Helper method that receives position in relation to the section, calculates the relative
position in the adapter and calls
RecyclerView.Adapter.notifyItemRangeInserted(int, int). |
void |
notifyItemRangeRemoved(int positionStart,
int itemCount)
Helper method that receives position in relation to the section, calculates the relative
position in the adapter and calls
RecyclerView.Adapter.notifyItemRangeRemoved(int, int). |
void |
notifyItemRemoved(int position)
Helper method that receives position in relation to the section, calculates the relative
position in the adapter and calls
RecyclerView.Adapter.notifyItemRemoved(int). |
void |
notifyNotLoadedStateChanged(Section.State previousState)
Helper method that calls
RecyclerView.Adapter.notifyItemChanged(int) with the position of the Section.State
view holder in the adapter. |
void |
notifySectionChangedToInvisible(int previousSectionPosition)
Helper method that calls
RecyclerView.Adapter.notifyItemRangeInserted(int, int) with the position of the section
in the adapter. |
void |
notifySectionChangedToVisible()
Helper method that calls
RecyclerView.Adapter.notifyItemRangeInserted(int, int) with the position of the section
in the adapter. |
void |
notifyStateChangedFromLoaded(int previousContentItemsCount)
Helper method that calls
RecyclerView.Adapter.notifyItemRangeRemoved(int, int) and RecyclerView.Adapter.notifyItemChanged(int) with
the position of the Section.State view holder in the adapter. |
void |
notifyStateChangedToLoaded(Section.State previousState)
Helper method that calls
RecyclerView.Adapter.notifyItemChanged(int) and RecyclerView.Adapter.notifyItemInserted(int) with
the position of the Section.State view holder in the adapter. |
public int getHeaderPosition()
public int getFooterPosition()
public int getSectionPosition()
public int getPositionInAdapter(int position)
position - position of the item in the sectionpublic int getPositionInSection(int position)
position - position of the item in the adapterpublic void notifyItemInserted(int position)
RecyclerView.Adapter.notifyItemInserted(int).position - position of the item in the sectionpublic void notifyAllItemsInserted()
RecyclerView.Adapter.notifyItemRangeInserted(int, int).public void notifyItemRangeInserted(int positionStart,
int itemCount)
RecyclerView.Adapter.notifyItemRangeInserted(int, int).positionStart - position of the first item that was inserted in the sectionitemCount - number of items inserted in the sectionpublic void notifyItemRemoved(int position)
RecyclerView.Adapter.notifyItemRemoved(int).position - position of the item in the sectionpublic void notifyItemRangeRemoved(int positionStart,
int itemCount)
RecyclerView.Adapter.notifyItemRangeRemoved(int, int).positionStart - previous position of the first item that was removed from the sectionitemCount - number of items removed from the sectionpublic void notifyHeaderChanged()
RecyclerView.Adapter.notifyItemChanged(int).public void notifyHeaderChanged(@Nullable
java.lang.Object payload)
RecyclerView.Adapter.notifyItemChanged(int).payload - optional parameter, use null to identify a "full" updatepublic void notifyFooterChanged()
RecyclerView.Adapter.notifyItemChanged(int).public void notifyFooterChanged(@Nullable
java.lang.Object payload)
RecyclerView.Adapter.notifyItemChanged(int).payload - optional parameter, use null to identify a "full" updatepublic void notifyItemChanged(int position)
RecyclerView.Adapter.notifyItemChanged(int).position - position of the item in the sectionpublic void notifyItemChanged(int position,
@Nullable
java.lang.Object payload)
RecyclerView.Adapter.notifyItemChanged(int).position - position of the item in the sectionpayload - optional parameter, use null to identify a "full" updatepublic void notifyAllItemsChanged()
RecyclerView.Adapter.notifyItemRangeChanged(int, int).public void notifyAllItemsChanged(@Nullable
java.lang.Object payload)
RecyclerView.Adapter.notifyItemRangeChanged(int, int).payload - optional parameter, use null to identify a "full" updatepublic void notifyItemRangeChanged(int positionStart,
int itemCount)
RecyclerView.Adapter.notifyItemRangeChanged(int, int).positionStart - position of the first item that was changed in the sectionitemCount - number of items changed in the sectionpublic void notifyItemRangeChanged(int positionStart,
int itemCount,
@Nullable
java.lang.Object payload)
RecyclerView.Adapter.notifyItemRangeChanged(int, int).positionStart - position of the first item that was inserted in the sectionitemCount - number of items inserted in the sectionpayload - optional parameter, use null to identify a "full" updatepublic void notifyItemMoved(int fromPosition,
int toPosition)
RecyclerView.Adapter.notifyItemMoved(int, int).fromPosition - previous position of the item in the sectiontoPosition - new position of the item in the sectionpublic void notifyNotLoadedStateChanged(Section.State previousState)
RecyclerView.Adapter.notifyItemChanged(int) with the position of the Section.State
view holder in the adapter. Useful to be called after changing the State from
LOADING/FAILED/EMPTY to LOADING/FAILED/EMPTY.previousState - previous state of sectionpublic void notifyStateChangedToLoaded(Section.State previousState)
RecyclerView.Adapter.notifyItemChanged(int) and RecyclerView.Adapter.notifyItemInserted(int) with
the position of the Section.State view holder in the adapter. Useful to be called after
changing the State from LOADING/FAILED/EMPTY to LOADED.previousState - previous state of sectionpublic void notifyStateChangedFromLoaded(int previousContentItemsCount)
RecyclerView.Adapter.notifyItemRangeRemoved(int, int) and RecyclerView.Adapter.notifyItemChanged(int) with
the position of the Section.State view holder in the adapter. Useful to be called after
changing the State from LOADED to LOADING/FAILED/EMPTY.previousContentItemsCount - previous content items count of sectionpublic void notifyHeaderInserted()
RecyclerView.Adapter.notifyItemInserted(int) with the position of the section's
header in the adapter. Useful to be called after changing the visibility of the section's
header to visible with Section.setHasHeader(boolean).public void notifyFooterInserted()
RecyclerView.Adapter.notifyItemInserted(int) with the position of the section's
footer in the adapter. Useful to be called after changing the visibility of the section's
footer to visible with Section.setHasFooter(boolean).public void notifyHeaderRemoved()
RecyclerView.Adapter.notifyItemRemoved(int) with the position of the section's
header in the adapter. Useful to be called after changing the visibility of the section's
header to invisible with Section.setHasHeader(boolean).public void notifyFooterRemoved()
RecyclerView.Adapter.notifyItemRemoved(int) with the position of the section's
footer in the adapter. Useful to be called after changing the visibility of the section's
footer to invisible with Section.setHasFooter(boolean).public void notifySectionChangedToVisible()
RecyclerView.Adapter.notifyItemRangeInserted(int, int) with the position of the section
in the adapter. Useful to be called after changing the visibility of the section to visible
with Section.setVisible(boolean).public void notifySectionChangedToInvisible(int previousSectionPosition)
RecyclerView.Adapter.notifyItemRangeInserted(int, int) with the position of the section
in the adapter. Useful to be called after changing the visibility of the section to invisible
with Section.setVisible(boolean).previousSectionPosition - previous section position