<commit_before>Android-ObservableScrollView
===

[![Build Status](https://travis-ci.org/ksoichiro/Android-ObservableScrollView.svg?branch=master)](https://travis-ci.org/ksoichiro/Android-ObservableScrollView)
[![Maven Central](http://img.shields.io/maven-central/v/com.github.ksoichiro/android-observablescrollview.svg)](https://github.com/ksoichiro/Android-ObservableScrollView/releases/latest)

Android library to observe scroll events on scrollable views.  
It's easy to interact with the Toolbar introduced in Android 5.0 Lollipop  and may be helpful to implement look and feel of Material Design apps.

![](observablescrollview-samples/demo1.gif)
![](observablescrollview-samples/demo2.gif)
![](observablescrollview-samples/demo3.gif)

![](observablescrollview-samples/demo4.gif)
![](observablescrollview-samples/demo5.gif)
![](observablescrollview-samples/demo6.gif)

## Installation

```groovy
dependencies {
    compile 'com.github.ksoichiro:android-observablescrollview:1.0.0'
}
```

## Samples

See `observablescrollview-samples` directory.

To install:

```sh
$ ./gradlew installDebug
```

## Supported widgets

* ListView
* ScrollView
* WebView


## How to use

### Add widgets to your layout

Use one of the `ObservableListView`, `ObservableScrollView`, `ObservableWebView` in your XML layout file.

### Control scroll events with callbacks

Widgets above provides callbacks with `ObservableScrollViewCallbacks` interface.  
You can listen scroll events of the widgets by using `setScrollViewCallbacks()`.

```java
    ObservableListView listView = (ObservableListView) findViewById(R.id.list);
    listView.setScrollViewCallbacks(this);
```

Then implement your interaction codes to the callbacks.  
Example:

```java
    @Override
    public void onUpOrCancelMotionEvent(ScrollState scrollState) {
        ActionBar ab = getSupportActionBar();
        if (scrollState == ScrollState.UP) {
            if (ab.isShowing()) {
                ab.hide();
            }
        } else if (scrollState == ScrollState.DOWN) {
            if (!ab.isShowing()) {
                ab.show();
            }
        }
    }
```

See sample project's `Activity` codes for more details.

## Developed By

* <NAME> - <<EMAIL>>


## License

    Copyright 2014 <NAME><commit_msg>Add credits.<commit_after>Android-ObservableScrollView
===

[![Build Status](https://travis-ci.org/ksoichiro/Android-ObservableScrollView.svg?branch=master)](https://travis-ci.org/ksoichiro/Android-ObservableScrollView)
[![Maven Central](http://img.shields.io/maven-central/v/com.github.ksoichiro/android-observablescrollview.svg)](https://github.com/ksoichiro/Android-ObservableScrollView/releases/latest)

Android library to observe scroll events on scrollable views.  
It's easy to interact with the Toolbar introduced in Android 5.0 Lollipop  and may be helpful to implement look and feel of Material Design apps.

![](observablescrollview-samples/demo1.gif)
![](observablescrollview-samples/demo2.gif)
![](observablescrollview-samples/demo3.gif)

![](observablescrollview-samples/demo4.gif)
![](observablescrollview-samples/demo5.gif)
![](observablescrollview-samples/demo6.gif)

## Installation

```groovy
dependencies {
    compile 'com.github.ksoichiro:android-observablescrollview:1.0.0'
}
```

## Samples

See `observablescrollview-samples` directory.

To install:

```sh
$ ./gradlew installDebug
```

## Supported widgets

* ListView
* ScrollView
* WebView


## How to use

### Add widgets to your layout

Use one of the `ObservableListView`, `ObservableScrollView`, `ObservableWebView` in your XML layout file.

### Control scroll events with callbacks

Widgets above provides callbacks with `ObservableScrollViewCallbacks` interface.  
You can listen scroll events of the widgets by using `setScrollViewCallbacks()`.

```java
    ObservableListView listView = (ObservableListView) findViewById(R.id.list);
    listView.setScrollViewCallbacks(this);
```

Then implement your interaction codes to the callbacks.  
Example:

```java
    @Override
    public void onUpOrCancelMotionEvent(ScrollState scrollState) {
        ActionBar ab = getSupportActionBar();
        if (scrollState == ScrollState.UP) {
            if (ab.isShowing()) {
                ab.hide();
            }
        } else if (scrollState == ScrollState.DOWN) {
            if (!ab.isShowing()) {
                ab.show();
            }
        }
    }
```

See sample project's `Activity` codes for more details.

## Developed By

* <NAME> - <<EMAIL>>


## Credits

* Inspired by `ObservableScrollView` in [romannurik-code](https://code.google.com/p/romannurik-code/).


## License

    Copyright 2014 <NAME>
{'fraction_non_alphanumeric': 0.12189374464438732, 'fraction_numerical': 0.006426735218508998, 'mean_word_length': 4.053030303030303, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 7, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2691947', 'n_tokens_mistral': 1503, 'n_tokens_neox': 1404, 'n_words': 326}