Methods Summary |
---|
long | getPackedPosition()
if (type == CHILD) return ExpandableListView.getPackedPositionForChild(groupPos, childPos);
else return ExpandableListView.getPackedPositionForGroup(groupPos);
|
private static android.widget.ExpandableListPosition | getRecycledOrCreate()
ExpandableListPosition elp;
synchronized (sPool) {
if (sPool.size() > 0) {
elp = sPool.remove(0);
} else {
return new ExpandableListPosition();
}
}
elp.resetState();
return elp;
|
static android.widget.ExpandableListPosition | obtain(int type, int groupPos, int childPos, int flatListPos)
ExpandableListPosition elp = getRecycledOrCreate();
elp.type = type;
elp.groupPos = groupPos;
elp.childPos = childPos;
elp.flatListPos = flatListPos;
return elp;
|
static android.widget.ExpandableListPosition | obtainChildPosition(int groupPosition, int childPosition)
return obtain(CHILD, groupPosition, childPosition, 0);
|
static android.widget.ExpandableListPosition | obtainGroupPosition(int groupPosition)
return obtain(GROUP, groupPosition, 0, 0);
|
static android.widget.ExpandableListPosition | obtainPosition(long packedPosition)
if (packedPosition == ExpandableListView.PACKED_POSITION_VALUE_NULL) {
return null;
}
ExpandableListPosition elp = getRecycledOrCreate();
elp.groupPos = ExpandableListView.getPackedPositionGroup(packedPosition);
if (ExpandableListView.getPackedPositionType(packedPosition) ==
ExpandableListView.PACKED_POSITION_TYPE_CHILD) {
elp.type = CHILD;
elp.childPos = ExpandableListView.getPackedPositionChild(packedPosition);
} else {
elp.type = GROUP;
}
return elp;
|
public void | recycle()
synchronized (sPool) {
if (sPool.size() < MAX_POOL_SIZE) {
sPool.add(this);
}
}
|
private void | resetState()
groupPos = 0;
childPos = 0;
flatListPos = 0;
type = 0;
|