| java.lang.Object | ||
| ↳ | android.support.v7.widget.RecyclerView.Adapter<VH extends android.support.v7.widget.RecyclerView.ViewHolder> | |
| ↳ | com.h6ah4i.android.widget.advrecyclerview.composedadapter.ComposedAdapter | |
Known Direct Subclasses
AbstractHeaderFooterWrapperAdapter<HeaderVH extends RecyclerView.ViewHolder, FooterVH extends RecyclerView.ViewHolder>
|
A wrapper adapter which can compose and manage several children adapters.
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| public static long | NO_SEGMENTED_POSITION | Corresponding segmented position value of NO_POSITION. |
|||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
ComposedAdapter()
Constructor.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| ComposedChildAdapterTag |
addAdapter(Adapter adapter, int position)
Adda child adapter to the specified position.
| ||||||||||
| ComposedChildAdapterTag |
addAdapter(Adapter adapter)
Add a child adapter to the tail.
| ||||||||||
| static int |
extractSegmentOffsetPart(long segmentedPosition)
Returns the offset value extracted from a segmented position.
| ||||||||||
| static int |
extractSegmentPart(long segmentedPosition)
Returns the segment value extracted from a segmented position.
| ||||||||||
| int |
getChildAdapterCount()
Returns the total number of children adapters.
| ||||||||||
| int |
getItemCount()
{@lineritDoc }
| ||||||||||
| long |
getItemId(int position)
| ||||||||||
| int |
getItemViewType(int position)
{@lineritDoc }
| ||||||||||
| int |
getSegment(ComposedChildAdapterTag tag)
Returns the assigned segment number.
| ||||||||||
| long |
getSegmentedPosition(int flatPosition)
Gets a "segmented position".
| ||||||||||
| void |
getWrappedAdapters(List<Adapter> adapters)
Gets wrapped children adapters.
| ||||||||||
| void |
onAttachedToRecyclerView(RecyclerView recyclerView)
{@lineritDoc }
| ||||||||||
| void |
onBindViewHolder(RecyclerView.ViewHolder holder, int position, List<Object> payloads)
{@lineritDoc }
| ||||||||||
| void |
onBindViewHolder(RecyclerView.ViewHolder holder, int position)
{@lineritDoc }
| ||||||||||
| void |
onBridgedAdapterChanged(Adapter source, Object tag)
{@lineritDoc }
| ||||||||||
| void |
onBridgedAdapterItemRangeChanged(Adapter source, Object tag, int positionStart, int itemCount, Object payload)
{@lineritDoc }
| ||||||||||
| void |
onBridgedAdapterItemRangeChanged(Adapter source, Object tag, int positionStart, int itemCount)
{@lineritDoc }
| ||||||||||
| void |
onBridgedAdapterItemRangeInserted(Adapter source, Object tag, int positionStart, int itemCount)
{@lineritDoc }
| ||||||||||
| void |
onBridgedAdapterItemRangeRemoved(Adapter source, Object tag, int positionStart, int itemCount)
{@lineritDoc }
| ||||||||||
| void |
onBridgedAdapterRangeMoved(Adapter source, Object tag, int fromPosition, int toPosition, int itemCount)
{@lineritDoc }
| ||||||||||
| RecyclerView.ViewHolder |
onCreateViewHolder(ViewGroup parent, int viewType)
{@lineritDoc }
| ||||||||||
| void |
onDetachedFromRecyclerView(RecyclerView recyclerView)
{@lineritDoc }
| ||||||||||
| boolean |
onFailedToRecycleView(RecyclerView.ViewHolder holder, int viewType)
{@lineritDoc }
| ||||||||||
| boolean |
onFailedToRecycleView(RecyclerView.ViewHolder holder)
{@lineritDoc }
| ||||||||||
| void |
onViewAttachedToWindow(RecyclerView.ViewHolder holder)
{@lineritDoc }
| ||||||||||
| void |
onViewAttachedToWindow(RecyclerView.ViewHolder holder, int viewType)
{@lineritDoc }
| ||||||||||
| void |
onViewDetachedFromWindow(RecyclerView.ViewHolder holder, int viewType)
{@lineritDoc }
| ||||||||||
| void |
onViewDetachedFromWindow(RecyclerView.ViewHolder holder)
{@lineritDoc }
| ||||||||||
| void |
onViewRecycled(RecyclerView.ViewHolder holder, int viewType)
{@lineritDoc }
| ||||||||||
| void |
onViewRecycled(RecyclerView.ViewHolder holder)
{@lineritDoc }
| ||||||||||
| void |
release()
Releases bounded resources.
| ||||||||||
| boolean |
removeAdapter(ComposedChildAdapterTag tag)
Remove a child adapter.
| ||||||||||
| void |
setHasStableIds(boolean hasStableIds)
{@liheritDoc }
| ||||||||||
| void |
unwrapPosition(UnwrapPositionResult dest, int position)
{@lineritDoc }
| ||||||||||
| int |
wrapPosition(AdapterPathSegment pathSegment, int position)
{@lineritDoc }
| ||||||||||
| Protected Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| void | onHandleWrappedAdapterChanged(Adapter sourceAdapter, List<ComposedChildAdapterTag> sourceTags) | ||||||||||
| void | onHandleWrappedAdapterItemRangeChanged(Adapter sourceAdapter, List<ComposedChildAdapterTag> sourceTags, int localPositionStart, int itemCount, Object payload) | ||||||||||
| void | onHandleWrappedAdapterItemRangeChanged(Adapter sourceAdapter, List<ComposedChildAdapterTag> sourceTags, int localPositionStart, int itemCount) | ||||||||||
| void | onHandleWrappedAdapterItemRangeInserted(Adapter sourceAdapter, List<ComposedChildAdapterTag> sourceTags, int localPositionStart, int itemCount) | ||||||||||
| void | onHandleWrappedAdapterItemRangeRemoved(Adapter sourceAdapter, List<ComposedChildAdapterTag> sourceTags, int localPositionStart, int itemCount) | ||||||||||
| void | onHandleWrappedAdapterRangeMoved(Adapter sourceAdapter, List<ComposedChildAdapterTag> sourceTags, int localFromPosition, int localToPosition, int itemCount) | ||||||||||
| void |
onRelease()
Implementation of the
release() method. | ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
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
| |||||||||||
Constructor.
Adda child adapter to the specified position.
| adapter | The adapter which to be managed by the ComposedAdapter |
|---|---|
| position | The position inserting a child adapter |
ComposedChildAdapterTagAdd a child adapter to the tail.
This method can be invoked before attaching (= call setAdapter(RecyclerView.Adapter)) to RecyclerView.
Also it may throws an IllegalStateException if the ComposedAdapter has been configured to support stable IDs,
| adapter | The adapter which to be managed by the ComposedAdapter |
|---|
ComposedChildAdapterTagReturns the offset value extracted from a segmented position.
| segmentedPosition | The segment position value to be converted |
|---|
Returns the segment value extracted from a segmented position.
| segmentedPosition | The segment position value to be converted |
|---|
Returns the total number of children adapters.
{@lineritDoc }
{@lineritDoc }
Returns the assigned segment number.
| tag | The tag object linked to a child adapter |
|---|
Gets a "segmented position".
The segmented position is a packed long value which contains "segment" and "offset inside of the segment" information.
| flatPosition | The normal flat position to be converted |
|---|
Gets wrapped children adapters.
| adapters | The destination |
|---|
{@lineritDoc }
{@lineritDoc }
{@lineritDoc }
{@lineritDoc }
| source | The source adapter |
|---|---|
| tag | The tag object |
{@lineritDoc }
| source | The source adapter |
|---|---|
| tag | The tag object |
| positionStart | Position of the first item that has changed |
| itemCount | Number of items that have changed |
| payload | Optional parameter, use null to identify a "full" update |
{@lineritDoc }
| source | The source adapter |
|---|---|
| tag | The tag object |
| positionStart | Position of the first item that has changed |
| itemCount | Number of items that have changed |
{@lineritDoc }
| source | The source adapter |
|---|---|
| tag | The tag object |
| positionStart | Position of the first item that was inserted |
| itemCount | Number of items inserted |
{@lineritDoc }
| source | The source adapter |
|---|---|
| tag | The tag object |
| positionStart | Previous position of the first item that was removed |
| itemCount | Number of items removed from the data set |
{@lineritDoc }
| source | The source adapter |
|---|---|
| tag | The tag object |
| fromPosition | Previous position of the item. |
| toPosition | New position of the item. |
| itemCount | Number of items moved (NOTE: this parameter is not actually used, always 1.) |
{@lineritDoc }
{@lineritDoc }
{@lineritDoc }
{@lineritDoc }
{@lineritDoc }
{@lineritDoc }
{@lineritDoc }
{@lineritDoc }
{@lineritDoc }
{@lineritDoc }
Releases bounded resources.
Remove a child adapter.
| tag | The tag object linked to a child adapter to be removed |
|---|
{@liheritDoc }
{@lineritDoc }
| dest | The destination |
|---|---|
| position | The wrapped position to be unwrapped |
{@lineritDoc }
| pathSegment | The path segment of the child adapter |
|---|---|
| position | The child adapter's position to be wrapped |