Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/vcaen/AndroidAutoHideHeader

A layout that hide the header when the body is scrolled down and reveal it when the header is scrolled up
https://github.com/vcaen/AndroidAutoHideHeader

Last synced: about 6 hours ago
JSON representation

A layout that hide the header when the body is scrolled down and reveal it when the header is scrolled up

Awesome Lists containing this project

README

        

# AndroidAutoHideHeader
[ ![Download](https://api.bintray.com/packages/vcaen/maven/androidautohideheader/images/download.svg) ](https://bintray.com/vcaen/maven/androidautohideheader/_latestVersion)
[ ![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-AndroidAutoHideHeader-blue.svg?style=flat)](http://android-arsenal.com/details/1/2285)

A layout that hide the header when the body is scrolled down and reveal it when the header is scrolled up

## Demo

![Demo gif](https://raw.githubusercontent.com/vcaen/AndroidAutoHideHeader/master/example.gif)

## Import it !

In your gradle "app" :

```
dependencies {
compile 'com.vcaen:androidautohideheader:1.2'
}
```

## Usage

### Basics

#### Programmatically
In you xml, add the '''AutoHideHeaderLayout''' :

```xml

```

Then in your java code :
```java
AutoHideHeaderLayout view = (AutoHideHeaderLayout) findViewById(R.id.autohideview);
ListView listView = new ListView(this);
view.setHeader(R.layout.header); // You can also set the View object
view.setBodyView(listView);
```

#### XML Only

You can add the children directly into the XML by adding them inside the ```AutoHideHeaderLayout``` :
```xml



```
### Options :

The following options are available :

* Fix the header

*Java*
```java
autoHideHeaderLayout.setFixed(Boolean)
```

*XML*
```xml
app:fixed="true"
```

* Fix the header if the child is smaller than the view. Only works if the child has height set at ```wrap_content```

*Java*
```java
autoHideHeaderLayout.setFixedIfChildSmall(Boolean)
```

*XML*
```xml
app:fixedIfChildSmall="true"
```

## License

The MIT License (MIT)

Copyright (c) 2015 Vadim Caen

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