java.lang.Object | |||
↳ | android.support.v7.widget.RecyclerView.Adapter<VH extends android.support.v7.widget.RecyclerView.ViewHolder> | ||
↳ | com.h6ah4i.android.widget.advrecyclerview.composedadapter.ComposedAdapter | ||
↳ | com.h6ah4i.android.widget.advrecyclerview.headerfooter.AbstractHeaderFooterWrapperAdapter<HeaderVH extends android.support.v7.widget.RecyclerView.ViewHolder, FooterVH extends android.support.v7.widget.RecyclerView.ViewHolder> |
A simplified version of ComposedAdapter for creating headers and footers.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
class | AbstractHeaderFooterWrapperAdapter.BaseFooterAdapter | ||||||||||
class | AbstractHeaderFooterWrapperAdapter.BaseHeaderAdapter |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | SEGMENT_TYPE_FOOTER | Segment type: footer items | |||||||||
int | SEGMENT_TYPE_HEADER | Segment type: header items | |||||||||
int | SEGMENT_TYPE_NORMAL | Segment type: normal items |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.h6ah4i.android.widget.advrecyclerview.composedadapter.ComposedAdapter
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AbstractHeaderFooterWrapperAdapter()
Constructor
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adapter |
getFooterAdapter()
Returns the adapter for the footer items.
| ||||||||||
abstract int |
getFooterItemCount()
Returns the total number of items in the data set hold by the footer adapter.
| ||||||||||
long |
getFooterItemId(int localPosition)
Return the stable ID for the item at
localPosition . | ||||||||||
int |
getFooterItemViewType(int localPosition)
Return the view type of the footer item at
localPosition for the purposes
of view recycling. | ||||||||||
AdapterPathSegment |
getFooterSegment()
Returns the path segment for the footer adapter.
| ||||||||||
Adapter |
getHeaderAdapter()
Returns the adapter for the header items.
| ||||||||||
abstract int |
getHeaderItemCount()
Returns the total number of items in the data set hold by the header adapter.
| ||||||||||
long |
getHeaderItemId(int localPosition)
Return the stable ID for the item at
localPosition . | ||||||||||
int |
getHeaderItemViewType(int localPosition)
Return the view type of the header item at
localPosition for the purposes
of view recycling. | ||||||||||
AdapterPathSegment |
getHeaderSegment()
Returns the path segment for the header adapter.
| ||||||||||
Adapter |
getWrappedAdapter()
Returns underlying adapter.
| ||||||||||
AdapterPathSegment |
getWrappedAdapterSegment()
Returns the path segment for the underlying adapter.
| ||||||||||
void |
onBindFooterItemViewHolder(FooterVH holder, int localPosition, List<Object> payloads)
Called by RecyclerView to display the data at the specified position.
| ||||||||||
abstract void |
onBindFooterItemViewHolder(FooterVH holder, int localPosition)
Called by RecyclerView to display the data at the specified position.
| ||||||||||
void |
onBindHeaderItemViewHolder(HeaderVH holder, int localPosition, List<Object> payloads)
Called by RecyclerView to display the data at the specified position.
| ||||||||||
abstract void |
onBindHeaderItemViewHolder(HeaderVH holder, int localPosition)
Called by RecyclerView to display the data at the specified position.
| ||||||||||
abstract FooterVH |
onCreateFooterItemViewHolder(ViewGroup parent, int viewType)
Called when RecyclerView needs a new RecyclerView.ViewHolder of the
given type to represent a footer item.
| ||||||||||
abstract HeaderVH |
onCreateHeaderItemViewHolder(ViewGroup parent, int viewType)
Called when RecyclerView needs a new RecyclerView.ViewHolder of the
given type to represent a header item.
| ||||||||||
AbstractHeaderFooterWrapperAdapter | setAdapter(Adapter<? extends RecyclerView.ViewHolder> adapter) |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adapter |
onCreateFooterAdapter()
Returns a newly created adapter for the footer items.
| ||||||||||
Adapter |
onCreateHeaderAdapter()
Returns a newly created adapter for header items.
| ||||||||||
void |
onRelease()
Implementation of the
release() method. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.h6ah4i.android.widget.advrecyclerview.composedadapter.ComposedAdapter
| |||||||||||
From class
android.support.v7.widget.RecyclerView.Adapter
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
com.h6ah4i.android.widget.advrecyclerview.adapter.BridgeAdapterDataObserver.Subscriber
| |||||||||||
From interface
com.h6ah4i.android.widget.advrecyclerview.adapter.WrappedAdapter
| |||||||||||
From interface
com.h6ah4i.android.widget.advrecyclerview.adapter.WrapperAdapter
|
Segment type: footer items
Segment type: header items
Segment type: normal items
Constructor
Returns the adapter for the footer items.
Returns the total number of items in the data set hold by the footer adapter.
Return the stable ID for the item at localPosition
. If hasStableIds()
would return false this method should return NO_ID
.
localPosition | Foote adapter position to query |
---|
Return the view type of the footer item at localPosition
for the purposes
of view recycling.
The default implementation of this method returns 0, making the assumption of a single view type for the adapter. Unlike ListView adapters, types need not be contiguous.
localPosition | The footer adapter local position to query |
---|
localPosition
. Type codes need not be contiguous.
Returns the path segment for the footer adapter.
Returns the adapter for the header items.
Returns the total number of items in the data set hold by the header adapter.
Return the stable ID for the item at localPosition
. If hasStableIds()
would return false this method should return NO_ID
.
localPosition | Header adapter position to query |
---|
Return the view type of the header item at localPosition
for the purposes
of view recycling.
The default implementation of this method returns 0, making the assumption of a single view type for the adapter. Unlike ListView adapters, types need not be contiguous.
localPosition | The header adapter local position to query |
---|
localPosition
. Type codes need not be contiguous.
Returns the path segment for the header adapter.
Returns underlying adapter.
Returns the path segment for the underlying adapter.
Called by RecyclerView to display the data at the specified position. This method should
update the contents of the itemView
to reflect the footer item
at the given position.
holder | The ViewHolder which should be updated to represent the contents of the item at the given position in the data set. |
---|---|
localPosition | The position of the item within the footer adapter's data set. |
payloads | A non-null list of merged payloads. Can be empty list if requires full update. |
Called by RecyclerView to display the data at the specified position. This method should
update the contents of the itemView
to reflect the footer item
at the given position.
holder | The ViewHolder which should be updated to represent the contents of the item at the given position in the data set. |
---|---|
localPosition | The position of the item within the footer adapter's data set. |
Called by RecyclerView to display the data at the specified position. This method should
update the contents of the itemView
to reflect the header item
at the given position.
holder | The ViewHolder which should be updated to represent the contents of the item at the given position in the data set. |
---|---|
localPosition | The position of the item within the header adapter's data set. |
payloads | A non-null list of merged payloads. Can be empty list if requires full update. |
Called by RecyclerView to display the data at the specified position. This method should
update the contents of the itemView
to reflect the header item
at the given position.
holder | The ViewHolder which should be updated to represent the contents of the item at the given position in the data set. |
---|---|
localPosition | The position of the item within the header adapter's data set. |
Called when RecyclerView needs a new RecyclerView.ViewHolder of the given type to represent a footer item.
parent | The ViewGroup into which the new View will be added after it is bound to a footer adapter position. |
---|---|
viewType | The view type of the new footer View. |
Called when RecyclerView needs a new RecyclerView.ViewHolder of the given type to represent a header item.
parent | The ViewGroup into which the new View will be added after it is bound to a header adapter position. |
---|---|
viewType | The view type of the new header View. |
adapter | Wrapped contents adapter. |
---|
Returns a newly created adapter for the footer items.
Returns a newly created adapter for header items.