public interface HeterogeneousExpandableList
android.widget.HeterogeneousExpandableList |
Known Indirect Subclasses |
实施时的其他方法使 ExpandableListAdapter
利用 Adapter
视图类型机制。
一个ExpandableListAdapter
声明它有一个视图类型的组项目和一个视图类型的子项目。 尽管适用于大多数ExpandableListView
,但这些值应该针对异构ExpandableListView
进行调整。
getGroupView(int, boolean, View, ViewGroup)
and
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.
Public methods |
|
---|---|
abstract int |
getChildType(int groupPosition, int childPosition) 获取指定子项目将由 |
abstract int |
getChildTypeCount() 返回将由 |
abstract int |
getGroupType(int groupPosition) 获取将由 |
abstract int |
getGroupTypeCount() 返回将由 |
int getChildType (int groupPosition, int childPosition)
获取将由 getChildView(int, int, boolean, View, ViewGroup)
创建的指定子项目的子视图类型。
Parameters | |
---|---|
groupPosition |
int : the position of the group that the child resides in |
childPosition |
int : the position of the child with respect to other children in the group |
Returns | |
---|---|
int |
An integer representing the type of child View. Two child views should share the same type if one can be converted to the other in getChildView(int, int, boolean, View, ViewGroup) Note: Integers must be in the range 0 to getChildTypeCount() - 1. IGNORE_ITEM_VIEW_TYPE can also be returned. |
int getChildTypeCount ()
返回将由getChildView(int, int, boolean, View, ViewGroup)
创建的子视图类型的数量。 每种类型都代表一组可以在getChildView(int, int, boolean, View, ViewGroup)
转换的视图集合。 如果适配器始终为所有子项返回相同类型的视图,则此方法应返回1。
AdapterView
.
Returns | |
---|---|
int |
The total number of types of child Views that will be created by this adapter. |
int getGroupType (int groupPosition)
获取将由getGroupView(int, boolean, View, ViewGroup)
创建的组视图类型。 为指定的组项目。
Parameters | |
---|---|
groupPosition |
int : the position of the group for which the type should be returned. |
Returns | |
---|---|
int |
An integer representing the type of group View. Two group views should share the same type if one can be converted to the other in getGroupView(int, boolean, View, ViewGroup) . Note: Integers must be in the range 0 to getGroupTypeCount() - 1. IGNORE_ITEM_VIEW_TYPE can also be returned. |
int getGroupTypeCount ()
返回将由getGroupView(int, boolean, View, ViewGroup)
创建的组视图类型的数量。 每种类型代表一组可以在getGroupView(int, boolean, View, ViewGroup)
转换的getGroupView(int, boolean, View, ViewGroup)
。 如果适配器始终为所有组项目返回相同类型的视图,则此方法应返回1。
AdapterView
.
Returns | |
---|---|
int |
The number of types of group Views that will be created by this adapter. |