From 8340afe0f66663f032dd999e2d377564df0bb6d5 Mon Sep 17 00:00:00 2001 From: Gilles Debunne Date: Thu, 11 Mar 2010 16:25:13 -0800 Subject: [PATCH] New HeterogeneousExpandableList interface. This interface can be used in conjunction with ExpandableListAdapter to declare more types of child and/or group views. None of the ExpandableListAdapter implementations is heterogeneous in the framework. BaseExpandableListAdapter was decalred to use this interface so that users see the methods and can overload. DateSortedExpandableListAdapter was left unchanged. This feature is related to http://b/issue?id=1459940 Change-Id: Ifc589b697913778b16abfdcaaa9f8f81e564add7 --- api/current.xml | 110 ++++++++++++++++++ .../widget/BaseExpandableListAdapter.java | 38 +++++- .../android/widget/ExpandableListAdapter.java | 3 +- .../widget/ExpandableListConnector.java | 29 ++++- .../widget/HeterogeneousExpandableList.java | 109 +++++++++++++++++ 5 files changed, 278 insertions(+), 11 deletions(-) create mode 100644 core/java/android/widget/HeterogeneousExpandableList.java diff --git a/api/current.xml b/api/current.xml index 64f0c23de5e45..cd11b1d57214f 100644 --- a/api/current.xml +++ b/api/current.xml @@ -199698,6 +199698,8 @@ > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + * 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}. + *

+ * + * @return The number of types of group Views that will be created by this adapter. + * @see getChildTypeCount() + * @see getGroupType() + */ + int getGroupTypeCount(); + + /** + *

+ * 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}. + *

+ * + * @return The total number of types of child Views that will be created by this adapter. + * @see getGroupTypeCount() + * @see getChildType() + */ + int getChildTypeCount(); +}