| com.h6ah4i.android.widget.advrecyclerview.expandable.ExpandableItemAdapter<GVH extends android.support.v7.widget.RecyclerView.ViewHolder, CVH extends android.support.v7.widget.RecyclerView.ViewHolder> |
Known Indirect Subclasses
AbstractExpandableItemAdapter<GVH extends RecyclerView.ViewHolder, CVH extends RecyclerView.ViewHolder>
|
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| abstract int |
getChildCount(int groupPosition)
Gets the number of children in a specified group.
| ||||||||||
| abstract long |
getChildId(int groupPosition, int childPosition)
Gets the ID for the given child within the given group. | ||||||||||
| abstract int |
getChildItemViewType(int groupPosition, int childPosition)
Gets the view type of the specified child.
| ||||||||||
| abstract int |
getGroupCount()
Gets the number of groups.
| ||||||||||
| abstract long |
getGroupId(int groupPosition)
Gets the ID for the group at the given position. | ||||||||||
| abstract int |
getGroupItemViewType(int groupPosition)
Gets the view type of the specified group.
| ||||||||||
| abstract boolean |
getInitialGroupExpandedState(int groupPosition)
Gets initial expanded state of the group item.
| ||||||||||
| abstract 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.
| ||||||||||
| abstract void |
onBindChildViewHolder(CVH holder, int groupPosition, int childPosition, int viewType)
Called by RecyclerView to display the child data at the specified position.
| ||||||||||
| abstract void |
onBindGroupViewHolder(GVH holder, int groupPosition, int viewType)
Called by RecyclerView to display the group data at the specified position.
| ||||||||||
| abstract void |
onBindGroupViewHolder(GVH holder, int groupPosition, int viewType, List<Object> payloads)
Called by RecyclerView to display the group data at the specified position.
| ||||||||||
| abstract boolean |
onCheckCanExpandOrCollapseGroup(GVH holder, int groupPosition, int x, int y, boolean expand)
Called when a user attempt to expand/collapse a group item by tapping. | ||||||||||
| abstract CVH |
onCreateChildViewHolder(ViewGroup parent, int viewType)
Called when RecyclerView needs a new CVH of the given type to represent a child item.
| ||||||||||
| abstract GVH |
onCreateGroupViewHolder(ViewGroup parent, int viewType)
Called when RecyclerView needs a new GVH of the given type to represent a group item.
| ||||||||||
| abstract boolean |
onHookGroupCollapse(int groupPosition, boolean fromUser, Object payload)
Called when a group attempt to expand by user operation or by
collapseGroup(int) method. | ||||||||||
| abstract boolean |
onHookGroupCollapse(int groupPosition, boolean fromUser)
Called when a group attempt to expand by user operation or by
collapseGroup(int) method. | ||||||||||
| abstract boolean |
onHookGroupExpand(int groupPosition, boolean fromUser)
Called when a group attempt to expand by user operation or by
expandGroup(int) method. | ||||||||||
| abstract boolean |
onHookGroupExpand(int groupPosition, boolean fromUser, Object payload)
Called when a group attempt to expand by user operation or by
expandGroup(int) method. | ||||||||||
Gets the number of children in a specified group.
| groupPosition | the position of the group for which the children count should be returned |
|---|
Gets the ID for the given child within the given group.
This ID must be unique across all children within the group.
The combined ID (see getCombinedChildId(long, long))
must be unique across ALL items (groups and all children).
| groupPosition | the position of the group that contains the child |
|---|---|
| childPosition | the position of the child within the group for which the ID is wanted |
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 number of groups.
Gets the ID for the group at the given position. This group ID must be unique across groups.
The combined ID (see getCombinedGroupId(long))
must be unique across ALL items (groups and all children).
| groupPosition | the position of the group for which the ID 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 |
|---|
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 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 |
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 |
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. |
Called when a user attempt to expand/collapse a group item by tapping.
Tips: If you want to set your own click event listener to group items, make this method always return false. It will disable auto expanding/collapsing when a group item is clicked.
| holder | The ViewHolder which is associated to group item user is attempt to expand/collapse |
|---|---|
| groupPosition | Group position |
| x | Touched X position. Relative from the itemView's top-left |
| y | Touched Y position. Relative from the itemView's top-left |
| expand | true: expand, false: collapse |
Called when RecyclerView needs a new CVH of the given type to represent a child item.
| parent | The ViewGroup into which the new View will be added after it is bound to an adapter position |
|---|---|
| viewType | The view type of the new View |
Called when RecyclerView needs a new GVH of the given type to represent a group item.
| parent | The ViewGroup into which the new View will be added after it is bound to an adapter position |
|---|---|
| viewType | The view type of the new View |
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 |
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 |
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 |
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 |