-
Notifications
You must be signed in to change notification settings - Fork 231
Gary edited this page Feb 8, 2015
·
3 revisions
##Integration
- Open up your Android project and create a new package in your project called com.idunnololz.widgets.
- Create a new Java source file in this package with the name AnimatedExpandableListView.
- Copy the source file [here] (https://github.com/idunnololz/AnimatedExpandableListView/blob/master/src/com/idunnololz/widgets/AnimatedExpandableListView.java) and paste it into the source file you just created in in step 2.
- You may now use this widget in your Android project.
##Using the widget
- In the desired layout file, you can add the AnimatedExpandableListView widget to the layout by creating a tag of the form
<com.idunnololz.widgets.AnimatedExpandableListView ... />
- The AnimatedExpandableListView has exactly the same interface as the standard Android ExpandableListView widget with a few differences. The AnimatedExpandableListView has the extra functions
expandGroupWithAnimation
andcollapseGroupWithAnimation
. Also, the AnimatedExpandableListView must be used with a AnimatedExpandableListAdapter. Examples of this could be found in the sample source.
##Migrating from ExpandableListView to AnimatedExpandableListView
If you are already using an ExpandableListView widget in your source and simply want to migrate to using this library, there are only a few changes needed to be made:
- Replace
ExpandableListView
withcom.idunnololz.widgets.AnimatedExpandableListView
in your layout file. - Make your adapter extend
AnimatedExpandableListAdapter
instead ofBaseExpandableListAdapter
. - Rename
getChildView()
andgetChildrenCount()
in your adapter togetRealChildView()
andgetRealChildrenCount()
respectively.