Skip to content
Gary edited this page Feb 8, 2015 · 3 revisions

##Integration

  1. Open up your Android project and create a new package in your project called com.idunnololz.widgets.
  2. Create a new Java source file in this package with the name AnimatedExpandableListView.
  3. 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.
  4. You may now use this widget in your Android project.

##Using the widget

  1. 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
        ... />
    
  2. The AnimatedExpandableListView has exactly the same interface as the standard Android ExpandableListView widget with a few differences. The AnimatedExpandableListView has the extra functions expandGroupWithAnimation and collapseGroupWithAnimation. 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:

  1. Replace ExpandableListView with com.idunnololz.widgets.AnimatedExpandableListView in your layout file.
  2. Make your adapter extend AnimatedExpandableListAdapter instead of BaseExpandableListAdapter.
  3. Rename getChildView() and getChildrenCount() in your adapter to getRealChildView() and getRealChildrenCount() respectively.
Clone this wiki locally