HeterogeneousExpandableListpublic interface HeterogeneousExpandableList Additional methods that when implemented make an
{@link ExpandableListAdapter} take advantage of the {@link Adapter} view type
mechanism.
An {@link ExpandableListAdapter} declares it has one view type for its group items
and one view type for its child items. Although adapted for most {@link ExpandableListView}s,
these values should be tuned for heterogeneous {@link ExpandableListView}s.
Lists that contain different types of group and/or child item views, should use an adapter that
implements this interface. This way, the recycled views that will be provided to
{@link android.widget.ExpandableListAdapter#getGroupView(int, boolean, View, ViewGroup)}
and
{@link android.widget.ExpandableListAdapter#getChildView(int, int, boolean, View, ViewGroup)}
will be of the appropriate group or child type, resulting in a more efficient reuse of the
previously created views. |
Methods Summary |
---|
public int | getChildType(int groupPosition, int childPosition)Get the type of child View that will be created by
{@link android.widget.ExpandableListAdapter#getChildView(int, int, boolean, View, ViewGroup)}
for the specified child item.
| public int | getChildTypeCount()
Returns the number of types of child Views that will be created by
{@link android.widget.ExpandableListAdapter#getChildView(int, int, boolean, View, ViewGroup)}
. Each type represents a set of views that can be converted in
{@link android.widget.ExpandableListAdapter#getChildView(int, int, boolean, View, ViewGroup)}
, for any group. If the adapter always returns the same type of View for
all child items, this method should return 1.
This method will only be called when the adapter is set on the {@link AdapterView}.
| public int | getGroupType(int groupPosition)Get the type of group View that will be created by
{@link android.widget.ExpandableListAdapter#getGroupView(int, boolean, View, ViewGroup)}
. for the specified group item.
| public int | getGroupTypeCount()
Returns the number of types of group Views that will be created by
{@link android.widget.ExpandableListAdapter#getGroupView(int, boolean, View, ViewGroup)}
. Each type represents a set of views that can be converted in
{@link android.widget.ExpandableListAdapter#getGroupView(int, boolean, View, ViewGroup)}
. If the adapter always returns the same type of View for all group items, this method should
return 1.
This method will only be called when the adapter is set on the {@link AdapterView}.
|
|