public class ExpandableList
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
boolean[] |
expandedGroupIndexes |
java.util.List<? extends ExpandableGroup> |
groups |
| Constructor and Description |
|---|
ExpandableList(java.util.List<? extends ExpandableGroup> groups) |
| Modifier and Type | Method and Description |
|---|---|
ExpandableGroup |
getExpandableGroup(ExpandableListPosition listPosition)
Translates either a group pos or a child pos to an
ExpandableGroup. |
int |
getExpandableGroupItemCount(ExpandableListPosition listPosition) |
int |
getFlattenedChildIndex(ExpandableListPosition listPosition)
Converts a child position to a flat list position.
|
int |
getFlattenedChildIndex(int groupIndex,
int childIndex)
Converts the details of a child's position to a flat list position.
|
int |
getFlattenedChildIndex(long packedPosition)
Converts a child position to a flat list position.
|
int |
getFlattenedFirstChildIndex(ExpandableListPosition listPosition) |
int |
getFlattenedFirstChildIndex(int groupIndex) |
int |
getFlattenedGroupIndex(ExpandableGroup group) |
int |
getFlattenedGroupIndex(ExpandableListPosition listPosition) |
int |
getFlattenedGroupIndex(int groupIndex) |
ExpandableListPosition |
getUnflattenedPosition(int flPos)
Translates a flat list position (the raw position of an item (child or group) in the list) to
either a) group pos if the specified flat list position corresponds to a group, or b) child
pos if it corresponds to a child.
|
int |
getVisibleItemCount() |
public java.util.List<? extends ExpandableGroup> groups
public boolean[] expandedGroupIndexes
public ExpandableList(java.util.List<? extends ExpandableGroup> groups)
public int getVisibleItemCount()
public ExpandableListPosition getUnflattenedPosition(int flPos)
flPos - the flat list position to be translatedExpandableListPosition object
that contains additional useful info for insertion, etc.public int getFlattenedGroupIndex(ExpandableListPosition listPosition)
listPosition - representing either a child or a groupgetVisibleItemCount()public int getFlattenedGroupIndex(int groupIndex)
groupIndex - representing the index of a group within groupsgetVisibleItemCount()public int getFlattenedGroupIndex(ExpandableGroup group)
group - an ExpandableGroup within groupsgetVisibleItemCount() or 0 if the
groups.indexOf cannot find the grouppublic int getFlattenedChildIndex(long packedPosition)
packedPosition - The child positions to be converted in it's
packed position representation.public int getFlattenedChildIndex(ExpandableListPosition listPosition)
listPosition - The child positions to be converted in it's
ExpandableListPosition representation.public int getFlattenedChildIndex(int groupIndex,
int childIndex)
groupIndex - The index of a group within groupschildIndex - the index of a child within it's ExpandableGrouppublic int getFlattenedFirstChildIndex(int groupIndex)
groupIndex - The index of a group within groupspublic int getFlattenedFirstChildIndex(ExpandableListPosition listPosition)
listPosition - The child positions to be converted in it's
ExpandableListPosition representation.public int getExpandableGroupItemCount(ExpandableListPosition listPosition)
listPosition - An ExpandableListPosition representing either a child or grouppublic ExpandableGroup getExpandableGroup(ExpandableListPosition listPosition)
ExpandableGroup.
If the ExpandableListPosition is a child position, it returns the ExpandableGroup it belongs tolistPosition - a ExpandableListPosition representing either a group position
or child positionExpandableGroup object that contains the listPosition