public override int getItemViewType(int flatListPos) { android.widget.ExpandableListPosition pos = getUnflattenedPos(flatListPos).position; int retValue; if (mExpandableListAdapter is android.widget.HeterogeneousExpandableList) { android.widget.HeterogeneousExpandableList adapter = (android.widget.HeterogeneousExpandableList )mExpandableListAdapter; if (pos.type == android.widget.ExpandableListPosition.GROUP) { retValue = adapter.getGroupType(pos.groupPos); } else { int childType = adapter.getChildType(pos.groupPos, pos.childPos); retValue = adapter.getGroupTypeCount() + childType; } } else { if (pos.type == android.widget.ExpandableListPosition.GROUP) { retValue = 0; } else { retValue = 1; } } pos.recycle(); return(retValue); }
public override int getViewTypeCount() { if (mExpandableListAdapter is android.widget.HeterogeneousExpandableList) { android.widget.HeterogeneousExpandableList adapter = (android.widget.HeterogeneousExpandableList )mExpandableListAdapter; return(adapter.getGroupTypeCount() + adapter.getChildTypeCount()); } else { return(2); } }