Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tjerkw/Android-SlideExpandableListView
A better ExpandableListView, with animated expandable views for each list item
https://github.com/tjerkw/Android-SlideExpandableListView
Last synced: 3 months ago
JSON representation
A better ExpandableListView, with animated expandable views for each list item
- Host: GitHub
- URL: https://github.com/tjerkw/Android-SlideExpandableListView
- Owner: tjerkw
- License: apache-2.0
- Created: 2012-06-22T20:28:16.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2019-10-31T20:53:26.000Z (about 5 years ago)
- Last Synced: 2024-10-29T17:51:05.502Z (3 months ago)
- Language: Java
- Size: 6.12 MB
- Stars: 1,974
- Watchers: 166
- Forks: 741
- Open Issues: 46
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-android-ui - https://github.com/tjerkw/Android-SlideExpandableListView
README
# SlideExpandableListView for Android
![Screenshot](https://github.com/tjerkw/Android-SlideExpandableListView/raw/master/raw/example-screens.png)
Not happy with the Android ExpandableListView android offers? Want something like the Spotify app. This library allows you to have custom listview in wich each list item has an area that will slide-out once the users clicks on a certain button.
## Features
* Provides a better ExpandableListView usable for normal ListView's
* Animates by default
* Easy to useRepository at .
## Usage
### Layout
Use a normal list view in your layout.
You may also use a ListActivity or ListFragment``` xml
```
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.For example here below we have R.id.expandable_toggle_button Button view.
And a R.id.expandable LinearLayout which will be expanded.
Note that the expandable view does not have to be a LinearLayout,
it can be any subclass of View.``` xml
```
### 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.``` java
ListView list = ... your list view
ListAdapter adapter = ... your list adapter
// now simply wrap the adapter
// and indicate the ids of your toggle button
// and expandable view
list.setAdapter(
new SlideExpandableListAdapter(
adapter,
R.id.expandable_toggle_button,
R.id.expandable
)
);
```### 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
Add the library as a gradle dependency to your project.
## Pull Requests
If you have any contributions I am gladly to review them and use them if they make sense.
## Changelog
### v1.1.0
* Added ActionSlideExpandableListView for easier event listening, see the sample app
* Updated the sample app to also contain event handling logic (Solved issue #3)
* Solved the issue with random views being expanded, due to recycling of views was not properly handled
* Solved more issues #1 #2### v1.0.0
* First release!
## Acknowledgments
* [TjerkWolterink] (http://about.me/tjerkw), about me (https://github.com/tjerkw), my linked in (http://www.linkedin.com/in/tjerkwolterink)
* [Udinic] (https://github.com/Udinic/SmallExamples/tree/master/ExpandAnimationExample), his blog (http://udinic.wordpress.com/2011/09/03/expanding-listview-items/) contains the initial idea## License
Licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html)
[![githalytics.com alpha](https://cruel-carlota.pagodabox.com/789c42a6ae45661a79e6e2695942ef65 "githalytics.com")](http://githalytics.com/tjerkw/Android-SlideExpandableListView)