Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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.*