Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/paolorotolo/expandableheightlistview
Expandable Height ListView for Android
https://github.com/paolorotolo/expandableheightlistview
Last synced: about 5 hours ago
JSON representation
Expandable Height ListView for Android
- Host: GitHub
- URL: https://github.com/paolorotolo/expandableheightlistview
- Owner: paolorotolo
- License: apache-2.0
- Created: 2015-05-23T15:32:14.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-15T23:48:36.000Z (almost 8 years ago)
- Last Synced: 2023-11-07T17:11:48.792Z (about 1 year ago)
- Language: Java
- Homepage:
- Size: 1.27 MB
- Stars: 208
- Watchers: 15
- Forks: 39
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ExpandableHeightListView
Android Library to put a **ListView** inside a **ScrollView** without collapsing.[![Maven Central](https://img.shields.io/badge/maven%20central-expandableheightlistview%3A1.0.0-brightgreen.svg)](http://search.maven.org/#artifactdetails|com.github.paolorotolo|expandableheightlistview|1.0.0|)
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-ExpandableHeightListView-green.svg?style=flat)](https://android-arsenal.com/details/1/1919)## How to use
Add this to your **build.gradle**:
```java
repositories {
mavenCentral()
}dependencies {
compile 'com.github.paolorotolo:expandableheightlistview:1.0.0'
}
```Add ExpandableHeightListView instead of ListView in your **xml files**:
```java
```
Expand ExpandableHeightListView **programmatically**:
```java
ExpandableHeightListView expandableListView = (ExpandableHeightListView) findViewById(R.id.expandable_listview);
expandableListView.setAdapter(adapterName);// This actually does the magic
expandableListView.setExpanded(true);
```It also works well with **GridView**.
Just use this instead:
```
```## Example
See it in action: download **test .apk** [here](https://github.com/PaoloRotolo/ExpandableHeightListView/raw/master/ExpandableHeightListViewExample/app/app-release.apk).Also check the example app's sources here on GitHub *(ExpandableHeightListViewExample)*.
##Wait, what?
Well, did you ever try to put a ListView inside a ScrollView?**This is what happens.**
And this is what you can do with **ExpandableHeightListView**.
*Inspired by [this](http://stackoverflow.com/questions/20659696/scroll-feature-of-listview-within-scroll-view) answer on StackOverflow.*