SlideExpandableListView for Android

1 comment

Features 


  • Provides a better ExpandableListView usable for normal ListView's
  • Animates by default
  • Easy to use

Usage

Layout

Use a normal list view in your layout. You may also use a ListActivity or ListFragment

The list item view should have a toggle button (Button view), and a target view that will be expanded. By default the expandable view will be hidden. An when a user clicks the toggle button the expandalbe view will slide out and be visible.

Wrap your ListAdapter


In order to provide the functionality you simply wrap your list adapter in a SlideExpandableListAdapter. The adapter gets the ids to the more button, and the expandable view as parameters. This allows the adapter to find those views.

Use the SlideExpandableListView or ActionSlideExpandableListView

In order to simplify the usage of this library, you can also use the mentioned ListViews directly in your layout xml file. The view itself will make sure the ListAdapter is wrapped in a SlideExpandableListAdapter.
See the sample app for usage information.

Including In Your Project

Currently you have to checkout the project, include it in your eclipse and ensure your project includes it.
I am working on putting it in maven Central so it can be easily added to any maven Android project.

A jar may also be an option, however i want to extend this library with android resources, which you cannot include as a jar file.

Pull Requests

If you have any contributions I am gladly to review them and use them if they make sense.
You can download the complete code of the application from this link.
Download link: http://goo.gl/wdfgD

1 comment:

  1. What's the difference between this and Tjerk's library over at http://tjerktech.wordpress.com/2012/06/23/an-emerging-android-ui-pattern-for-contextual-actions/ ?

    ReplyDelete