Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/traex/ExpandableLayout
Implementation of ExpandableListview with custom header and custom content.
https://github.com/traex/ExpandableLayout
Last synced: 14 days ago
JSON representation
Implementation of ExpandableListview with custom header and custom content.
- Host: GitHub
- URL: https://github.com/traex/ExpandableLayout
- Owner: traex
- License: mit
- Created: 2014-09-15T19:59:54.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2022-07-20T17:08:04.000Z (over 2 years ago)
- Last Synced: 2024-07-31T18:16:17.294Z (3 months ago)
- Language: Java
- Homepage:
- Size: 706 KB
- Stars: 1,635
- Watchers: 61
- Forks: 361
- Open Issues: 64
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- -awesome-android-ui - ExpandableLayout
- awesome-android-ui - ExpandableLayout
- awesome-android-ui - ExpandableLayout
README
ExpandableLayout
================![ExpandableLayout](https://github.com/traex/ExpandableLayout/blob/master/header.png)
ExpandableLayout provides an easy way to create a view called header with an expandable view. Both view are external layout to allow a maximum of customization. [You can find a sample](https://github.com/traex/ExpandableLayout/blob/master/sample/) that how to use an ExpandableLayout to your layout.
![ExpandableLayout GIF](https://github.com/traex/ExpandableLayout/blob/master/demo.gif)
### Integration
The lib is available on Maven Central, you can find it with [Gradle, please](http://gradleplease.appspot.com/#expandablelayout)``` xml
dependencies {
compile 'com.github.traex.expandablelayout:library:1.2.2'
}```
### Usage
#### ExpandableLayout
Declare an ExpandableLayout inside your XML layout file. You also need to other layouts for header and content:
``` xml
```#### ExpandableLayoutItem && ExpandableLayoutItem
You can use ExapandableLayout in an `ExpandableLayoutListView` with `ExpandableLayoutItem` as row :
ExpandableLayoutItem
``` xml
```ExpandableLayoutListView
``` xml
```
If you want to manage the OnScroll, you have to use `OnExpandableLayoutScrollListener` and don't forget to call super in each method.You can call dynamically `open`, `close` and `isOpened` from an ExpandableLayout object.
### Customization
You can change duration of the animation:
* app:duration [integer def:200] --> Duration of the animation
### Troubleshooting
If you want to use the `ExpandableLayoutListView` with EditText, you have to set `android:windowSoftInputMode="adjustPan"` to prevent the ListView to redraw itself and close the ExpandableLayoutItem.
### Acknowledgements
Thanks to [Google](http://developer.android.com/reference/android/widget/ExpandableListView.html) for its ExpandableListview :)
### MIT License
```
The MIT License (MIT)
Copyright (c) 2014 Robin Chutaux
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
```