Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ninjinkun/scrollfullscreen
Scroll to full screen for Android
https://github.com/ninjinkun/scrollfullscreen
Last synced: 3 months ago
JSON representation
Scroll to full screen for Android
- Host: GitHub
- URL: https://github.com/ninjinkun/scrollfullscreen
- Owner: ninjinkun
- License: mit
- Created: 2014-08-17T10:45:32.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-09-27T13:22:58.000Z (over 10 years ago)
- Last Synced: 2023-04-21T10:48:28.785Z (almost 2 years ago)
- Language: Java
- Size: 257 KB
- Stars: 11
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ScrollFullScreen
![ScreenCast](https://cloud.githubusercontent.com/assets/113420/4385617/b0c7063c-43c6-11e4-9e53-0a8623d3ed93.gif)
ScrollFullScreen is scroll to full screen library like Google I/O 2014 App. It supports ListView, ScrollView, WebView.
# Usage
## 1. Implement OnFullScreenListener and instance ScrollDetector
ScrollFullScreen does **not provide full screen behevior**. You should implement your own beheivior to listener.
```java
ScrollDetector scrollDetector = new ScrollDetector(new OnFullScreenListener() {
@Override
public void onFullScreenStarted() {
// Implement full screen beheivior
getSupportActionBar().hide();
}@Override
public void onFullScreenFinished() {
getSupportActionBar().show();
}
});
```## 2. Attach to view
### ListView
Instance ListViewAdapter and set OnScreenListener to ListView.
```java
ListView listView = getListView();
ListViewAdapter listViewAdapter = new ListViewAdapter.Builder(scrollDetector).build();
listView.setOnScrollListener(listViewAdapter); // ListViewAdapter implements AbsListView.OnScrollListener
```### WebView, ScrollView
Use ScrollViewAdapter and add OnScrollChangedListener to ScrollView's ViewTreeObserver.
```java
WebView webView = (WebView)findViewById(R.id.webview);
ScrollViewAdapter scrollViewAdapter = new ScrollViewAdapter.Builder(webView, scrollDetector).build();
webView.getViewTreeObserver().addOnScrollChangedListener(scrollViewAdapter); // ScrollViewAdapter implements ViewTreeObserver.OnScrollChangedListener
```# Requrements
- ListView
- Android 2.3 or later
- ScrollView, WebView
- Android 4.0 or later# Download
We are planing to upload maven later.
# License
[Apache]: http://www.apache.org/licenses/LICENSE-2.0
[MIT]: http://www.opensource.org/licenses/mit-license.php
[GPL]: http://www.gnu.org/licenses/gpl.html
[BSD]: http://opensource.org/licenses/bsd-license.php
[MIT license][MIT].