java.lang.Object | ||
↳ | android.support.v7.widget.RecyclerView.Adapter<VH extends android.support.v7.widget.RecyclerView.ViewHolder> | |
↳ | com.h6ah4i.android.widget.advrecyclerview.utils.AbstractExpandableItemAdapter<GVH extends android.support.v7.widget.RecyclerView.ViewHolder, CVH extends android.support.v7.widget.RecyclerView.ViewHolder> |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AbstractExpandableItemAdapter() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int |
getChildItemViewType(int groupPosition, int childPosition)
Gets the view type of the specified child.
| ||||||||||
int |
getGroupItemViewType(int groupPosition)
Gets the view type of the specified group.
| ||||||||||
boolean |
getInitialGroupExpandedState(int groupPosition)
Gets initial expanded state of the group item.
| ||||||||||
final int |
getItemCount()
This method will not be called.
| ||||||||||
final long |
getItemId(int position)
This method will not be called.
| ||||||||||
final int |
getItemViewType(int position)
This method will not be called.
| ||||||||||
void |
onBindChildViewHolder(CVH holder, int groupPosition, int childPosition, int viewType, List<Object> payloads)
Called by RecyclerView to display the child data at the specified position.
| ||||||||||
void |
onBindGroupViewHolder(GVH holder, int groupPosition, int viewType, List<Object> payloads)
Called by RecyclerView to display the group data at the specified position.
| ||||||||||
final void |
onBindViewHolder(RecyclerView.ViewHolder holder, int position)
This method will not be called.
| ||||||||||
final RecyclerView.ViewHolder |
onCreateViewHolder(ViewGroup parent, int viewType)
This method will not be called.
| ||||||||||
boolean |
onHookGroupCollapse(int groupPosition, boolean fromUser, Object payload)
Override this method if need to customize the behavior.
| ||||||||||
boolean |
onHookGroupCollapse(int groupPosition, boolean fromUser)
Override this method if need to customize the behavior.
| ||||||||||
boolean |
onHookGroupExpand(int groupPosition, boolean fromUser)
Override this method if need to customize the behavior.
| ||||||||||
boolean |
onHookGroupExpand(int groupPosition, boolean fromUser, Object payload)
Override this method if need to customize the behavior.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
android.support.v7.widget.RecyclerView.Adapter
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
com.h6ah4i.android.widget.advrecyclerview.expandable.ExpandableItemAdapter
|
Gets the view type of the specified child.
groupPosition | the position of the group that contains the child |
---|---|
childPosition | the position of the child within the group for which the view type is wanted |
Gets the view type of the specified group.
groupPosition | the position of the group for which the view type is wanted |
---|
Gets initial expanded state of the group item. This method is called when initially creating a wrapper adapter and also when the data set is changed.
groupPosition | The position of the group |
---|
This method will not be called.
Override getGroupCount()
and getChildCount(int)
instead.
This method will not be called.
Override getGroupId(int)
and getChildId(int, int)
instead.
position | not used |
---|
This method will not be called.
Override getGroupItemViewType(int)
and getChildItemViewType(int, int)
instead.
position | not used |
---|
Called by RecyclerView to display the child data at the specified position.
This method should update the contents of the itemView
to reflect the 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 |
---|---|
groupPosition | The position of the group item within the adapter's data set |
childPosition | The position of the child item within the group |
viewType | The view type code |
payloads | A non-null list of merged payloads. Can be empty list if requires full update. |
Called by RecyclerView to display the group data at the specified position.
This method should update the contents of the itemView
to reflect the 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 |
---|---|
groupPosition | The position of the group item within the adapter's data set |
viewType | The view type code |
payloads | A non-null list of merged payloads. Can be empty list if requires full update. |
This method will not be called.
Override onBindGroupViewHolder(RecyclerView.ViewHolder, int, int)
()} and
onBindChildViewHolder(RecyclerView.ViewHolder, int, int, int)
instead.
holder | not used |
---|---|
position | not used |
This method will not be called.
Override onCreateGroupViewHolder(android.view.ViewGroup, int)
and
onCreateChildViewHolder(android.view.ViewGroup, int)
instead.
parent | not used |
---|---|
viewType | not used |
Override this method if need to customize the behavior.
Called when a group attempt to expand by user operation or by
collapseGroup(int)
method.
groupPosition | The position of the group item within the adapter's data set |
---|---|
fromUser | Whether the collapse request is issued by a user operation |
payload | Optional parameter, use null to identify a "full" update the group item |
Override this method if need to customize the behavior.
Called when a group attempt to expand by user operation or by
collapseGroup(int)
method.
groupPosition | The position of the group item within the adapter's data set |
---|---|
fromUser | Whether the collapse request is issued by a user operation |
Override this method if need to customize the behavior.
Called when a group attempt to expand by user operation or by
expandGroup(int)
method.
groupPosition | The position of the group item within the adapter's data set |
---|---|
fromUser | Whether the expand request is issued by a user operation |
Override this method if need to customize the behavior.
Called when a group attempt to expand by user operation or by
expandGroup(int)
method.
groupPosition | The position of the group item within the adapter's data set |
---|---|
fromUser | Whether the expand request is issued by a user operation |
payload | Optional parameter, use null to identify a "full" update the group item |