├── library ├── res │ └── .gitkeep ├── .gitignore ├── gradle.properties ├── AndroidManifest.xml ├── src │ ├── androidTest │ │ ├── res │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── dimens.xml │ │ │ │ └── styles.xml │ │ │ ├── color │ │ │ │ └── tab_text_color.xml │ │ │ └── layout │ │ │ │ ├── padding.xml │ │ │ │ ├── fragment_webview.xml │ │ │ │ ├── activity_webview.xml │ │ │ │ ├── fragment_listview.xml │ │ │ │ ├── activity_listview.xml │ │ │ │ ├── activity_recyclerview.xml │ │ │ │ ├── fragment_gridview.xml │ │ │ │ ├── activity_gridview.xml │ │ │ │ ├── fragment_recyclerview.xml │ │ │ │ ├── tab_indicator.xml │ │ │ │ ├── activity_scrollview.xml │ │ │ │ ├── fragment_scrollview_noheader.xml │ │ │ │ └── fragment_scrollview.xml │ │ └── java │ │ │ └── com │ │ │ └── github │ │ │ └── ksoichiro │ │ │ └── android │ │ │ └── observablescrollview │ │ │ └── test │ │ │ ├── RecyclerViewScrollFromBottomActivity.java │ │ │ ├── ListViewScrollFromBottomActivity.java │ │ │ ├── ScrollUtilsTest.java │ │ │ ├── ScrollViewActivity.java │ │ │ ├── ListViewScrollFromBottomActivityTest.java │ │ │ ├── WebViewActivity.java │ │ │ ├── RecyclerViewScrollFromBottomActivityTest.java │ │ │ ├── RecyclerViewActivity.java │ │ │ ├── GridViewActivity.java │ │ │ ├── ListViewActivity.java │ │ │ ├── TouchInterceptionWebViewActivityTest.java │ │ │ ├── TouchInterceptionGridViewActivityTest.java │ │ │ ├── TouchInterceptionListViewActivityTest.java │ │ │ ├── TouchInterceptionRecyclerViewActivityTest.java │ │ │ ├── ViewPagerTab2ScrollViewFragment.java │ │ │ ├── ViewPagerTab2WebViewFragment.java │ │ │ └── ViewPagerTab2GridViewFragment.java │ └── main │ │ └── java │ │ └── com │ │ └── github │ │ └── ksoichiro │ │ └── android │ │ └── observablescrollview │ │ ├── ScrollState.java │ │ └── ObservableScrollViewCallbacks.java └── build.gradle ├── samples ├── .gitignore ├── images │ ├── demo1.gif │ ├── demo2.gif │ ├── demo3.gif │ ├── demo4.gif │ ├── demo5.gif │ ├── demo6.gif │ ├── demo7.gif │ ├── demo8.gif │ ├── demo9.gif │ ├── demo10.gif │ ├── demo11.gif │ ├── demo12.gif │ └── demo13.gif ├── ic_launcher-web.png ├── res │ ├── drawable │ │ ├── example.jpeg │ │ ├── sliding_header_overlay.xml │ │ └── gradient_header_background.xml │ ├── drawable-xhdpi │ │ └── ic_launcher.png │ ├── drawable-xxhdpi │ │ └── ic_launcher.png │ ├── drawable-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_action_info.png │ ├── layout │ │ ├── fragment_flexiblespacewithimagerecyclerview.xml │ │ ├── padding.xml │ │ ├── fragment_fragmenttransition_default.xml │ │ ├── activity_fragmentactionbarcontrol.xml │ │ ├── divider.xml │ │ ├── fragment_webview.xml │ │ ├── fragment_listview.xml │ │ ├── activity_handletouchwebview.xml │ │ ├── activity_actionbarcontrollistview.xml │ │ ├── activity_actionbarcontrolwebview.xml │ │ ├── activity_handletouchlistview.xml │ │ ├── fragment_actionbarcontrollistview.xml │ │ ├── activity_handletouchrecyclerview.xml │ │ ├── gradient_header.xml │ │ ├── fragment_gridview.xml │ │ ├── activity_handletouchgridview.xml │ │ ├── activity_actionbarcontrolgridview.xml │ │ ├── fragment_recyclerview.xml │ │ ├── activity_actionbarcontrolrecyclerview.xml │ │ ├── recycler_header.xml │ │ ├── fragment_fragmenttransition_second.xml │ │ ├── tab_indicator.xml │ │ ├── fragment_flexiblespacewithimagelistview.xml │ │ ├── fragment_flexiblespacewithimagegridview.xml │ │ ├── activity_viewpagertabfragment.xml │ │ ├── activity_actionbarcontrolscrollview.xml │ │ ├── activity_toolbarcontrolwebview.xml │ │ ├── list_item_main.xml │ │ ├── activity_toolbarcontrollistview.xml │ │ ├── activity_fragmenttransition.xml │ │ ├── activity_toolbarcontrolrecyclerview.xml │ │ ├── activity_toolbarcontrolgridview.xml │ │ ├── list_item_handletouch.xml │ │ ├── fragment_scrollview_noheader.xml │ │ ├── fragment_scrollview.xml │ │ └── fragment_viewpagertabfragment_parent.xml │ ├── values-ar │ │ └── strings.xml │ ├── color │ │ └── tab_text_color.xml │ ├── values │ │ ├── colors.xml │ │ └── dimens.xml │ ├── values-w820dp │ │ └── dimens.xml │ ├── menu │ │ └── menu_main.xml │ └── layout-v11 │ │ └── tab_indicator.xml ├── src │ ├── debug │ │ └── res │ │ │ ├── drawable-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── drawable-xxhdpi │ │ │ └── ic_launcher.png │ │ │ └── drawable-xxxhdpi │ │ │ └── ic_launcher.png │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── github │ │ │ └── ksoichiro │ │ │ └── app │ │ │ └── ApplicationTest.java │ └── main │ │ └── java │ │ └── com │ │ └── github │ │ └── ksoichiro │ │ └── android │ │ └── observablescrollview │ │ └── samples │ │ ├── ToolbarControlScrollViewActivity.java │ │ ├── ToolbarControlGridViewActivity.java │ │ ├── ToolbarControlWebViewActivity.java │ │ ├── FillGap2BaseActivity.java │ │ ├── SlidingUpScrollViewActivity.java │ │ ├── SlidingUpWebViewActivity.java │ │ ├── FillGap2ScrollViewActivity.java │ │ ├── FillGap3ScrollViewActivity.java │ │ ├── FillGapScrollViewActivity.java │ │ ├── ToolbarControlRecyclerViewActivity.java │ │ ├── FillGap3ListViewActivity.java │ │ ├── FragmentActionBarControlListViewActivity.java │ │ ├── ViewPagerTabScrollViewWithFabActivity.java │ │ ├── FillGap3RecyclerViewActivity.java │ │ ├── ViewPagerTabFragmentActivity.java │ │ ├── ViewPagerTab2ScrollViewFragment.java │ │ ├── ViewPagerTab2GridViewFragment.java │ │ ├── ViewPagerTab2ListViewFragment.java │ │ ├── ViewPagerTab2WebViewFragment.java │ │ ├── FillGap2ListViewActivity.java │ │ ├── FillGapListViewActivity.java │ │ ├── SlidingUpGridViewActivity.java │ │ └── SlidingUpListViewActivity.java ├── proguard-rules.pro └── README.md ├── settings.gradle ├── docs ├── contributor │ ├── ci.md │ ├── update-website.md │ ├── _data.json │ └── index.md ├── images │ ├── basic_1.png │ ├── basic_2.png │ ├── basic_3.png │ ├── basic_4.png │ ├── basic_5.png │ ├── basic_6.png │ ├── basic_7.png │ ├── wercker_1.png │ ├── wercker_2.png │ └── wercker_3.png ├── _data.json ├── reference │ ├── index.md │ ├── _data.json │ ├── supported-widgets.md │ └── environment.md ├── advanced │ ├── _data.json │ ├── viewpager.md │ ├── index.md │ └── sliding-up.md ├── quick-start │ ├── _data.json │ ├── index.md │ ├── layout.md │ └── dependencies.md ├── example │ ├── _data.json │ ├── index.md │ ├── google-play.md │ ├── wercker.md │ └── android-studio.md ├── basic │ ├── _data.json │ └── index.md ├── overview.md └── _layout.ejs ├── website ├── .bowerrc ├── public │ ├── 404.ejs │ ├── favicon.ico │ ├── apple-icon.png │ ├── thumbnail.png │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── favicon-96x96.png │ ├── ms-icon-70x70.png │ ├── ms-icon-144x144.png │ ├── ms-icon-150x150.png │ ├── ms-icon-310x310.png │ ├── android-icon-36x36.png │ ├── android-icon-48x48.png │ ├── android-icon-72x72.png │ ├── android-icon-96x96.png │ ├── apple-icon-114x114.png │ ├── apple-icon-120x120.png │ ├── apple-icon-144x144.png │ ├── apple-icon-152x152.png │ ├── apple-icon-180x180.png │ ├── apple-icon-57x57.png │ ├── apple-icon-60x60.png │ ├── apple-icon-72x72.png │ ├── apple-icon-76x76.png │ ├── android-icon-144x144.png │ ├── android-icon-192x192.png │ ├── apple-icon-precomposed.png │ ├── css │ │ ├── _mixins.less │ │ ├── main.less │ │ ├── _footer.less │ │ ├── _fonts.less │ │ ├── _layout.less │ │ ├── _misc.less │ │ ├── _navbar.less │ │ ├── _colors.less │ │ ├── _code.less │ │ ├── _sidebar.less │ │ ├── _roboto-fonts.less │ │ └── _site-top.less │ ├── browserconfig.xml │ ├── _layout.ejs │ ├── _data.json │ ├── manifest.json │ ├── _footer.ejs │ ├── _nav.ejs │ ├── index.ejs │ └── js │ │ └── main.coffee ├── .gitignore ├── harp.json ├── package.json └── bower.json ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── .editorconfig ├── gradle.properties ├── .travis-script.sh ├── wercker.yml └── CONTRIBUTING.md /library/res/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /library/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /samples/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | /src/version/ 3 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':library', ':samples' 2 | -------------------------------------------------------------------------------- /docs/contributor/ci.md: -------------------------------------------------------------------------------- 1 | # CI 2 | 3 | Coming soon... 4 | -------------------------------------------------------------------------------- /website/.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "bower_components" 3 | } 4 | -------------------------------------------------------------------------------- /website/public/404.ejs: -------------------------------------------------------------------------------- 1 |

404

2 |

Page Not Found

3 | -------------------------------------------------------------------------------- /docs/contributor/update-website.md: -------------------------------------------------------------------------------- 1 | # Update website 2 | 3 | Coming soon... 4 | -------------------------------------------------------------------------------- /docs/images/basic_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/docs/images/basic_1.png -------------------------------------------------------------------------------- /docs/images/basic_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/docs/images/basic_2.png -------------------------------------------------------------------------------- /docs/images/basic_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/docs/images/basic_3.png -------------------------------------------------------------------------------- /docs/images/basic_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/docs/images/basic_4.png -------------------------------------------------------------------------------- /docs/images/basic_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/docs/images/basic_5.png -------------------------------------------------------------------------------- /docs/images/basic_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/docs/images/basic_6.png -------------------------------------------------------------------------------- /docs/images/basic_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/docs/images/basic_7.png -------------------------------------------------------------------------------- /samples/images/demo1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/samples/images/demo1.gif -------------------------------------------------------------------------------- /samples/images/demo2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/samples/images/demo2.gif -------------------------------------------------------------------------------- /samples/images/demo3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/samples/images/demo3.gif -------------------------------------------------------------------------------- /samples/images/demo4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/samples/images/demo4.gif -------------------------------------------------------------------------------- /samples/images/demo5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/samples/images/demo5.gif -------------------------------------------------------------------------------- /samples/images/demo6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/samples/images/demo6.gif -------------------------------------------------------------------------------- /samples/images/demo7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/samples/images/demo7.gif -------------------------------------------------------------------------------- /samples/images/demo8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/samples/images/demo8.gif -------------------------------------------------------------------------------- /samples/images/demo9.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/samples/images/demo9.gif -------------------------------------------------------------------------------- /website/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | bower_components/ 3 | public/lib/ 4 | public/docs/ 5 | www/ 6 | repo/ 7 | *.log 8 | -------------------------------------------------------------------------------- /docs/images/wercker_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/docs/images/wercker_1.png -------------------------------------------------------------------------------- /docs/images/wercker_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/docs/images/wercker_2.png -------------------------------------------------------------------------------- /docs/images/wercker_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/docs/images/wercker_3.png -------------------------------------------------------------------------------- /samples/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/samples/ic_launcher-web.png -------------------------------------------------------------------------------- /samples/images/demo10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/samples/images/demo10.gif -------------------------------------------------------------------------------- /samples/images/demo11.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/samples/images/demo11.gif -------------------------------------------------------------------------------- /samples/images/demo12.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/samples/images/demo12.gif -------------------------------------------------------------------------------- /samples/images/demo13.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/samples/images/demo13.gif -------------------------------------------------------------------------------- /website/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/website/public/favicon.ico -------------------------------------------------------------------------------- /docs/_data.json: -------------------------------------------------------------------------------- 1 | { 2 | "overview": { 3 | "title": "Overview" 4 | }, 5 | "faq": { 6 | "title": "FAQ" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /website/public/apple-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/website/public/apple-icon.png -------------------------------------------------------------------------------- /website/public/thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/website/public/thumbnail.png -------------------------------------------------------------------------------- /library/gradle.properties: -------------------------------------------------------------------------------- 1 | POM_NAME=Android-ObservableScrollView 2 | POM_ARTIFACT_ID=android-observablescrollview 3 | POM_PACKAGING=aar 4 | -------------------------------------------------------------------------------- /website/public/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/website/public/favicon-16x16.png -------------------------------------------------------------------------------- /website/public/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/website/public/favicon-32x32.png -------------------------------------------------------------------------------- /website/public/favicon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/website/public/favicon-96x96.png -------------------------------------------------------------------------------- /website/public/ms-icon-70x70.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/website/public/ms-icon-70x70.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /samples/res/drawable/example.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/samples/res/drawable/example.jpeg -------------------------------------------------------------------------------- /website/public/ms-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/website/public/ms-icon-144x144.png -------------------------------------------------------------------------------- /website/public/ms-icon-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/website/public/ms-icon-150x150.png -------------------------------------------------------------------------------- /website/public/ms-icon-310x310.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/website/public/ms-icon-310x310.png -------------------------------------------------------------------------------- /website/public/android-icon-36x36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/website/public/android-icon-36x36.png -------------------------------------------------------------------------------- /website/public/android-icon-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/website/public/android-icon-48x48.png -------------------------------------------------------------------------------- /website/public/android-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/website/public/android-icon-72x72.png -------------------------------------------------------------------------------- /website/public/android-icon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/website/public/android-icon-96x96.png -------------------------------------------------------------------------------- /website/public/apple-icon-114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/website/public/apple-icon-114x114.png -------------------------------------------------------------------------------- /website/public/apple-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/website/public/apple-icon-120x120.png -------------------------------------------------------------------------------- /website/public/apple-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/website/public/apple-icon-144x144.png -------------------------------------------------------------------------------- /website/public/apple-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/website/public/apple-icon-152x152.png -------------------------------------------------------------------------------- /website/public/apple-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/website/public/apple-icon-180x180.png -------------------------------------------------------------------------------- /website/public/apple-icon-57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/website/public/apple-icon-57x57.png -------------------------------------------------------------------------------- /website/public/apple-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/website/public/apple-icon-60x60.png -------------------------------------------------------------------------------- /website/public/apple-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/website/public/apple-icon-72x72.png -------------------------------------------------------------------------------- /website/public/apple-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/website/public/apple-icon-76x76.png -------------------------------------------------------------------------------- /website/public/android-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/website/public/android-icon-144x144.png -------------------------------------------------------------------------------- /website/public/android-icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/website/public/android-icon-192x192.png -------------------------------------------------------------------------------- /samples/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/samples/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /website/public/apple-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/website/public/apple-icon-precomposed.png -------------------------------------------------------------------------------- /samples/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/samples/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /samples/res/drawable-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/samples/res/drawable-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /samples/res/drawable-xxxhdpi/ic_action_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/samples/res/drawable-xxxhdpi/ic_action_info.png -------------------------------------------------------------------------------- /samples/src/debug/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/samples/src/debug/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /samples/src/debug/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/samples/src/debug/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /samples/src/debug/res/drawable-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ksoichiro/Android-ObservableScrollView/HEAD/samples/src/debug/res/drawable-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /website/public/css/_mixins.less: -------------------------------------------------------------------------------- 1 | // Overwrite bootstrap's default 2 | .override-container(@width: 970px) { 3 | @media (min-width: 1200px) { 4 | & { 5 | width: @width; 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /docs/reference/index.md: -------------------------------------------------------------------------------- 1 | # Reference 2 | 3 | 1. [Supported widgets](../../docs/basic/supported-widgets.md) 4 | 1. [Environment](../../docs/reference/environment.md) 5 | 1. [Release notes](../../docs/reference/release-notes.md) 6 | -------------------------------------------------------------------------------- /docs/advanced/_data.json: -------------------------------------------------------------------------------- 1 | { 2 | "index": { 3 | "title": "Advanced techniques" 4 | }, 5 | "sliding-up": { 6 | "title": "Sliding up pattern" 7 | }, 8 | "viewpager": { 9 | "title": "ViewPager pattern" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | *.iml 3 | *.keystore 4 | /local.properties 5 | private.properties 6 | /.idea/ 7 | .DS_Store 8 | /build 9 | bin/ 10 | gen/ 11 | libs/ 12 | aarDependencies/ 13 | .project 14 | .classpath 15 | project.properties 16 | *.swp 17 | -------------------------------------------------------------------------------- /docs/contributor/_data.json: -------------------------------------------------------------------------------- 1 | { 2 | "index": { 3 | "title": "For contributors" 4 | }, 5 | "ci": { 6 | "title": "CI" 7 | }, 8 | "update-website": { 9 | "title": "Update website" 10 | }, 11 | "release": { 12 | "title": "Release" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /docs/contributor/index.md: -------------------------------------------------------------------------------- 1 | # For contributors 2 | 3 | This section explains some operations for managing the project. 4 | 5 | 1. [CI](../../docs/contributor/ci.md) 6 | 1. [Update website](../../docs/contributor/update-website.md) 7 | 1. [Release](../../docs/contributor/release.md) 8 | 9 | -------------------------------------------------------------------------------- /docs/quick-start/_data.json: -------------------------------------------------------------------------------- 1 | { 2 | "index": { 3 | "title": "Quick start" 4 | }, 5 | "dependencies": { 6 | "title": "Dependencies" 7 | }, 8 | "layout": { 9 | "title": "Layout" 10 | }, 11 | "animation": { 12 | "title": "Animation codes" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Apr 10 15:27:10 PDT 2013 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip 7 | -------------------------------------------------------------------------------- /docs/reference/_data.json: -------------------------------------------------------------------------------- 1 | { 2 | "index": { 3 | "title": "Rerefence" 4 | }, 5 | "supported-widgets": { 6 | "title": "Supported widgets" 7 | }, 8 | "environment": { 9 | "title": "Environment" 10 | }, 11 | "release-notes": { 12 | "title": "Release notes" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /website/public/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | #ffffff -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 4 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [{.travis.yml,.travis-script.sh,*.json,*.coffee,*.less}] 12 | indent_size = 2 13 | 14 | [*.md] 15 | trim_trailing_whitespace = false 16 | -------------------------------------------------------------------------------- /website/public/_layout.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | <%- partial("_head") %> 5 | 6 | 7 | 8 | <%- partial("_nav") %> 9 | 10 |
11 |
12 |
13 | <%- yield %> 14 |
15 |
16 |
17 | 18 | <%- partial("_footer") %> 19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/advanced/viewpager.md: -------------------------------------------------------------------------------- 1 | # ViewPager pattern 2 | 3 | This topic describes how to integrate scrollable views with ViewPager, 4 | which are implemented in the following examples. 5 | 6 | * ViewPagerTab2Activity 7 | * ViewPagerTabActivity 8 | * ViewPagerTabFragmentActivity 9 | * ViewPagerTabListViewActivity 10 | * ViewPagerTabScrollViewActivity 11 | 12 | --- 13 | 14 | Coming soon... 15 | -------------------------------------------------------------------------------- /docs/example/_data.json: -------------------------------------------------------------------------------- 1 | { 2 | "index": { 3 | "title": "Try the example app" 4 | }, 5 | "google-play": { 6 | "title": "Download from Google Play" 7 | }, 8 | "wercker": { 9 | "title": "Download from wercker" 10 | }, 11 | "android-studio": { 12 | "title": "Build on Android Studio" 13 | }, 14 | "eclipse": { 15 | "title": "Build on Eclipse" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /website/public/css/main.less: -------------------------------------------------------------------------------- 1 | @import (reference) '../../bower_components/bootstrap/less/bootstrap.less'; 2 | @import (reference) '_mixins.less'; 3 | @import '_fonts.less'; 4 | @import '_colors.less'; 5 | @import '_layout.less'; 6 | @import '_navbar.less'; 7 | @import '_footer.less'; 8 | @import '_sidebar.less'; 9 | @import '_site-top.less'; 10 | @import '_code.less'; 11 | @import '_misc.less'; 12 | -------------------------------------------------------------------------------- /docs/quick-start/index.md: -------------------------------------------------------------------------------- 1 | # Quick start 2 | 3 | Thank you for having interest in this library! 4 | In this section, I'll show some quick instructions for introducing this library into your app. 5 | 6 | 1. [Dependencies](../../docs/quick-start/dependencies.md) 7 | 1. [Layout](../../docs/quick-start/layout.md) 8 | 1. [Animation codes](../../docs/quick-start/animation.md) 9 | 10 | [Next: Dependencies »](../../docs/quick-start/dependencies.md) 11 | -------------------------------------------------------------------------------- /docs/advanced/index.md: -------------------------------------------------------------------------------- 1 | # Advanced techniques 2 | 3 | This section describes advanced scrolling techniques. 4 | When you've done this topic, you could be be an expert of handling scrolls! 5 | I'd appreciate it if you could suggest new patterns or improvements of the library. 6 | 7 | 1. [Sliding up pattern](../../docs/advanced/sliding-up.md) 8 | 1. [ViewPager pattern](../../docs/advanced/viewpager.md) 9 | 10 | [Next: Sliding up pattern »](../../docs/advanced/sliding-up.md) 11 | -------------------------------------------------------------------------------- /samples/src/androidTest/java/com/github/ksoichiro/app/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.github.ksoichiro.myapplication; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /docs/advanced/sliding-up.md: -------------------------------------------------------------------------------- 1 | # Sliding up pattern 2 | 3 | This topic describes how to slide a panel from the bottom like Google's "Map" app, 4 | which are implemented in the following examples. 5 | 6 | * SlidingUpBaseActivity 7 | * SlidingUpGridViewActivity 8 | * SlidingUpListViewActivity 9 | * SlidingUpRecyclerViewActivity 10 | * SlidingUpScrollViewActivity 11 | * SlidingUpWebViewActivity 12 | 13 | --- 14 | 15 | Coming soon... 16 | 17 | [Next: ViewPager pattern »](../../docs/advanced/viewpager.md) 18 | -------------------------------------------------------------------------------- /docs/example/index.md: -------------------------------------------------------------------------------- 1 | # Try the examples app 2 | 3 | To understand how it works, let's see the existing example app 4 | and check if there are some patterns you want to implement. 5 | 6 | 1. [Download from Google Play](../../docs/example/google-play.md) 7 | 1. [Download from wercker](../../docs/eaxmple/wercker.md) 8 | 1. [Build on Android Studio](../../docs/example/android-studio.md) 9 | 1. [Build on Eclipse](../../docs/example/eclipse.md) 10 | 11 | [Next: Download from Google Play »](../../docs/example/google-play.md) 12 | -------------------------------------------------------------------------------- /website/public/_data.json: -------------------------------------------------------------------------------- 1 | { 2 | "index": { 3 | "title": "Android-ObservableScrollView", 4 | "layout": false 5 | }, 6 | "quick-start": { 7 | "title": "Quick start" 8 | }, 9 | "example": { 10 | "title": "Try the example app" 11 | }, 12 | "basic": { 13 | "title": "Basic techniques" 14 | }, 15 | "advanced": { 16 | "title": "Advanced techniques" 17 | }, 18 | "contributor": { 19 | "title": "For contributors" 20 | }, 21 | "reference": { 22 | "title": "Reference" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /website/public/css/_footer.less: -------------------------------------------------------------------------------- 1 | @import (reference) '_mixins.less'; 2 | 3 | // Footer 4 | .footer { 5 | .container; 6 | .override-container; 7 | padding: 15px; 8 | border-top: 1px solid lighten(#E0F2F1, 7%); 9 | .btns { 10 | text-align: right; 11 | padding-bottom: 15px; 12 | .ghstar { 13 | width: 100px; 14 | height: 20px; 15 | } 16 | .ghfork { 17 | width: 100px; 18 | height: 20px; 19 | } 20 | } 21 | .copyright { 22 | .text-muted; 23 | .clearfix; 24 | text-align: right; 25 | font-size: 12px; 26 | line-height: 150%; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /website/harp.json: -------------------------------------------------------------------------------- 1 | { 2 | "globals": { 3 | "baseUrl": "$BASE_URL", 4 | "title": "Android-ObservableScrollView", 5 | "name": "Android-ObservableScrollView", 6 | "description": "Android library to observe scroll events on scrollable views.", 7 | "githubUser": "ksoichiro", 8 | "githubRepo": "Android-ObservableScrollView", 9 | "githubUrl": "https://github.com/ksoichiro/Android-ObservableScrollView", 10 | "ogType": "website", 11 | "ogUrl": "http://ksoichiro.github.io/Android-ObservableScrollView", 12 | "copyrightYear": "2014", 13 | "copyrightHolder": "Soichiro Kashima" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /docs/basic/_data.json: -------------------------------------------------------------------------------- 1 | { 2 | "index": { 3 | "title": "Basic techniques" 4 | }, 5 | "show-hide-action-bar": { 6 | "title": "Show and hide the ActionBar" 7 | }, 8 | "translating-toolbar": { 9 | "title": "Translating the Toolbar" 10 | }, 11 | "parallax-image": { 12 | "title": "Parallax image" 13 | }, 14 | "sticky-header": { 15 | "title": "Sticky header" 16 | }, 17 | "flexible-space-toolbar": { 18 | "title": "Flexible space on the Toolbar" 19 | }, 20 | "flexible-space-with-image": { 21 | "title": "Flexible space with image" 22 | }, 23 | "filling-gap": { 24 | "title": "Filling gap on top of the Toolbar" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /docs/reference/supported-widgets.md: -------------------------------------------------------------------------------- 1 | # Supported widgets 2 | 3 | Widgets are named with `Observable` prefix. 4 | (e.g. `ListView` → `ObservableListView`) 5 | You can handle these widgets with `Scrollable` interface. 6 | 7 | | Widget | Since | Note | 8 | |:------:|:-----:| ---- | 9 | | ListView | v1.0.0 | - | 10 | | ScrollView | v1.0.0 | - | 11 | | WebView | v1.0.0 | - | 12 | | RecyclerView | v1.1.0 | It's supported but RecyclerView provides scroll states and position with [OnScrollListener](https://developer.android.com/reference/android/support/v7/widget/RecyclerView.OnScrollListener.html). You should use it if you don't have any reason. | 13 | | GridView | v1.2.0 | - | 14 | -------------------------------------------------------------------------------- /docs/example/google-play.md: -------------------------------------------------------------------------------- 1 | # Download from Google Play 2 | 3 | Click the following link to download the example app from Google Play. 4 | 5 | [![Get it on Google Play](https://developer.android.com/images/brand/en_generic_rgb_wo_45.png)](https://play.google.com/store/apps/details?id=com.github.ksoichiro.android.observablescrollview.samples2) 6 | 7 | Please note that the app on the Play Store is not always the latest version. 8 | If you'd like to install the latest one, 9 | 10 | * install it manually. 11 | * or if you are a wercker user, you can download the latest build artifact from wercker. 12 | 13 | [Next: Download from wercker »](../../docs/example/wercker.md) 14 | -------------------------------------------------------------------------------- /docs/basic/index.md: -------------------------------------------------------------------------------- 1 | # Basic techniques 2 | 3 | This section explains the basic scrolling techniques. 4 | 5 | 1. [Show and hide the ActionBar](../../docs/basic/show-hide-action-bar.md) 6 | 1. [Translating the Toolbar](../../docs/basic/translating-toolbar.md) 7 | 1. [Parallax image](../../docs/basic/parallax-image.md) 8 | 1. [Sticky header](../../docs/basic/sticky-header.md) 9 | 1. [Flexible space on the Toolbar](../../docs/basic/flexible-space-toolbar.md) 10 | 1. [Flexible space with image](../../docs/basic/flexible-space-with-image.md) 11 | 1. [Filling gap on top of the Toolbar](../../docs/basic/filling-gap.md) 12 | 13 | [Next: Show and hide the ActionBar »](../../docs/basic/show-hide-action-bar.md) 14 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | VERSION_NAME=1.7.0-SNAPSHOT 2 | SYNCED_VERSION_NAME=1.5.2 3 | GROUP=com.github.ksoichiro 4 | 5 | POM_DESCRIPTION=Android library to observe scroll events on scrollable views. 6 | POM_URL=https://github.com/ksoichiro/Android-ObservableScrollView 7 | POM_SCM_URL=https://github.com/ksoichiro/Android-ObservableScrollView 8 | POM_SCM_CONNECTION=scm:git:git://github.com/ksoichiro/Android-ObservableScrollView.git 9 | POM_SCM_DEV_CONNECTION=scm:git:git@github.com:ksoichiro/Android-ObservableScrollView.git 10 | POM_LICENCE_NAME=Apache License 2.0 11 | POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0 12 | POM_LICENCE_DIST=repo 13 | POM_DEVELOPER_ID=ksoichiro 14 | POM_DEVELOPER_NAME=Soichiro Kashima 15 | -------------------------------------------------------------------------------- /samples/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Applications/adt-bundle-mac-x86_64-20131030/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /samples/res/layout/fragment_flexiblespacewithimagerecyclerview.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 11 | 12 | 17 | 18 | -------------------------------------------------------------------------------- /library/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /website/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Android-ObservableScrollView", 3 | "description": "Web site for Android-ObservableScrollView", 4 | "repository": { 5 | "type": "git", 6 | "url": "https://github.com/ksoichiro/Android-ObservableScrollView.git" 7 | }, 8 | "dependencies": { 9 | }, 10 | "devDependencies": { 11 | "bower": "1.3.12", 12 | "gulp": "3.8.11", 13 | "del": "1.1.1", 14 | "harp": "0.17.0", 15 | "main-bower-files": "2.7.0", 16 | "gulp-git": "1.2.1", 17 | "gulp-util": "3.0.4" 18 | }, 19 | "scripts": { 20 | "prepublish": "bower install --config.interactive=false", 21 | "start": "gulp start", 22 | "copy": "gulp copy", 23 | "build": "gulp build", 24 | "deploy": "gulp deploy", 25 | "clean": "gulp clean" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /.travis-script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "TEST_TARGET=${TEST_TARGET}" 4 | echo "TRAVIS_PULL_REQUEST=${TRAVIS_PULL_REQUEST}" 5 | echo "TRAVIS_BRANCH=${TRAVIS_BRANCH}" 6 | 7 | if [ "$TEST_TARGET" = "android" ]; then 8 | # Release build type is only for Google Play store currently, 9 | # which resolve dependency from Maven Central. 10 | # This causes build errors while developing a new feature, so disable release build. 11 | ./gradlew --full-stacktrace assembleDevDebug :library:connectedCheck 12 | elif [ "$TEST_TARGET" = "website" ]; then 13 | if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "master" ] && [ ! -z "$GH_TOKEN" ]; then 14 | echo "Update website..." 15 | pushd website > /dev/null 2>&1 16 | npm run deploy 17 | popd > /dev/null 2>&1 18 | fi 19 | fi 20 | -------------------------------------------------------------------------------- /samples/res/values-ar/strings.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | الفضاء مرن 19 | 20 | 21 | -------------------------------------------------------------------------------- /website/public/css/_fonts.less: -------------------------------------------------------------------------------- 1 | @import '_roboto-fonts.less'; 2 | 3 | body, h1, h2, h3, h4, h5, h6, p { 4 | font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif; 5 | font-weight: 300; 6 | color: #212121; 7 | } 8 | body { 9 | font-size: 14px; 10 | } 11 | h1 { 12 | font-size: 28px; 13 | font-weight: 400; 14 | } 15 | h2 { 16 | font-size: 22px; 17 | font-weight: 400; 18 | } 19 | h3 { 20 | font-size: 20px; 21 | } 22 | #sidebar-main-content { 23 | font-size: 16px; 24 | h1 { 25 | font-size: 32px; 26 | } 27 | h2 { 28 | font-size: 28px; 29 | } 30 | h3 { 31 | font-size: 22px; 32 | font-weight: 400; 33 | } 34 | h4 { 35 | font-size: 18px; 36 | font-weight: 400; 37 | } 38 | h5 { 39 | font-size: 16px; 40 | font-weight: 400; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /website/public/css/_layout.less: -------------------------------------------------------------------------------- 1 | @import (reference) '_mixins.less'; 2 | 3 | html, 4 | body { 5 | overflow-x: hidden; 6 | } 7 | 8 | body { 9 | padding-top: 70px; 10 | } 11 | 12 | h1 { 13 | margin-top: 8px; 14 | } 15 | 16 | // Markdown fix 17 | // Apply .table to all s 18 | table { 19 | .table; 20 | } 21 | 22 | .container { 23 | .override-container; 24 | } 25 | 26 | #sidebar-main-content { 27 | h1 { 28 | margin-bottom: 16px; 29 | } 30 | h2 { 31 | margin-top: 34px; 32 | margin-bottom: 18px; 33 | } 34 | h3 { 35 | margin-top: 26px; 36 | margin-bottom: 16px; 37 | } 38 | h4 { 39 | margin-top: 22px; 40 | margin-bottom: 16px; 41 | } 42 | h5 { 43 | margin-top: 20px; 44 | margin-bottom: 16px; 45 | } 46 | p, ol, ul, pre { 47 | margin-bottom: 16px; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /samples/README.md: -------------------------------------------------------------------------------- 1 | # Samples 2 | 3 | This sample project demonstrates how the Android-ObservableScrollView works. 4 | 5 | This document's goal is to lead you to run the sample app and help understanding how to use this library. 6 | 7 | Please note that this document is still work in progress. 8 | Although I've built the app on Android Studio, Eclipse, Gradle on Mac and Gradle on Linux of Travis CI, there might be some implicit dependencies which I haven't noticed and you couldn't build it correctly. 9 | Therefore I'd greatly appreciate it if you report it to me. 10 | 11 | ## How to build 12 | 13 | ### on Android Studio 14 | 15 | TODO 16 | 17 | ### on Eclipse 18 | 19 | TODO 20 | 21 | ### on Gradle 22 | 23 | Windows: 24 | 25 | ```sh 26 | > gradlew installDevDebug 27 | ``` 28 | 29 | Linux/Mac: 30 | 31 | ```sh 32 | $ ./gradlew installDevDebug 33 | ``` -------------------------------------------------------------------------------- /library/src/androidTest/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | #009688 19 | #00796b 20 | #eeff41 21 | 22 | 23 | -------------------------------------------------------------------------------- /samples/res/color/tab_text_color.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /samples/res/layout/padding.xml: -------------------------------------------------------------------------------- 1 | 16 | 20 | -------------------------------------------------------------------------------- /library/src/androidTest/res/color/tab_text_color.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /samples/res/layout/fragment_fragmenttransition_default.xml: -------------------------------------------------------------------------------- 1 | 16 | 20 | -------------------------------------------------------------------------------- /library/src/androidTest/res/layout/padding.xml: -------------------------------------------------------------------------------- 1 | 16 | 20 | -------------------------------------------------------------------------------- /samples/res/layout/activity_fragmentactionbarcontrol.xml: -------------------------------------------------------------------------------- 1 | 16 | 20 | -------------------------------------------------------------------------------- /samples/res/layout/divider.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | -------------------------------------------------------------------------------- /samples/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | #009688 19 | #00796b 20 | #eeff41 21 | #F4FF81 22 | 23 | 24 | -------------------------------------------------------------------------------- /samples/res/drawable/sliding_header_overlay.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /samples/res/drawable/gradient_header_background.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /website/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "App", 3 | "icons": [ 4 | { 5 | "src": "\/android-icon-36x36.png", 6 | "sizes": "36x36", 7 | "type": "image\/png", 8 | "density": "0.75" 9 | }, 10 | { 11 | "src": "\/android-icon-48x48.png", 12 | "sizes": "48x48", 13 | "type": "image\/png", 14 | "density": "1.0" 15 | }, 16 | { 17 | "src": "\/android-icon-72x72.png", 18 | "sizes": "72x72", 19 | "type": "image\/png", 20 | "density": "1.5" 21 | }, 22 | { 23 | "src": "\/android-icon-96x96.png", 24 | "sizes": "96x96", 25 | "type": "image\/png", 26 | "density": "2.0" 27 | }, 28 | { 29 | "src": "\/android-icon-144x144.png", 30 | "sizes": "144x144", 31 | "type": "image\/png", 32 | "density": "3.0" 33 | }, 34 | { 35 | "src": "\/android-icon-192x192.png", 36 | "sizes": "192x192", 37 | "type": "image\/png", 38 | "density": "4.0" 39 | } 40 | ] 41 | } -------------------------------------------------------------------------------- /samples/res/layout/fragment_webview.xml: -------------------------------------------------------------------------------- 1 | 16 | 20 | -------------------------------------------------------------------------------- /samples/res/layout/fragment_listview.xml: -------------------------------------------------------------------------------- 1 | 16 | 20 | -------------------------------------------------------------------------------- /docs/quick-start/layout.md: -------------------------------------------------------------------------------- 1 | # Layout 2 | 3 | After adding the dependency, let's write layout file such as `res/layout/activity_main.xml`. 4 | 5 | This time, we'll use only one element `ObservableListView`. 6 | 7 | ```xml 8 | 13 | ``` 14 | 15 | Android-ObservableScrollView provides several types of views that are scroll-able such as `ObservableScrollView`, `ObservableGridView`, etc. 16 | And they extend the standard widget (`ScrollView`, `GridView`, ...), and they provide some callbacks to get scroll events. 17 | 18 | After writing the above layout, you can write animation codes using these callbacks. 19 | 20 | [Next: Animation codes »](../../docs/quick-start/animation.md) 21 | -------------------------------------------------------------------------------- /samples/res/layout/activity_handletouchwebview.xml: -------------------------------------------------------------------------------- 1 | 16 | 20 | -------------------------------------------------------------------------------- /library/src/androidTest/res/layout/fragment_webview.xml: -------------------------------------------------------------------------------- 1 | 16 | 20 | -------------------------------------------------------------------------------- /samples/res/layout/activity_actionbarcontrollistview.xml: -------------------------------------------------------------------------------- 1 | 16 | 20 | -------------------------------------------------------------------------------- /samples/res/layout/activity_actionbarcontrolwebview.xml: -------------------------------------------------------------------------------- 1 | 16 | 20 | -------------------------------------------------------------------------------- /samples/res/layout/activity_handletouchlistview.xml: -------------------------------------------------------------------------------- 1 | 16 | 20 | -------------------------------------------------------------------------------- /samples/res/layout/fragment_actionbarcontrollistview.xml: -------------------------------------------------------------------------------- 1 | 16 | 20 | -------------------------------------------------------------------------------- /library/src/androidTest/res/layout/activity_webview.xml: -------------------------------------------------------------------------------- 1 | 16 | 20 | -------------------------------------------------------------------------------- /library/src/androidTest/res/layout/fragment_listview.xml: -------------------------------------------------------------------------------- 1 | 16 | 20 | -------------------------------------------------------------------------------- /samples/res/layout/activity_handletouchrecyclerview.xml: -------------------------------------------------------------------------------- 1 | 16 | 20 | -------------------------------------------------------------------------------- /library/src/androidTest/res/layout/activity_listview.xml: -------------------------------------------------------------------------------- 1 | 16 | 20 | -------------------------------------------------------------------------------- /samples/res/layout/gradient_header.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | -------------------------------------------------------------------------------- /docs/reference/environment.md: -------------------------------------------------------------------------------- 1 | # Environment 2 | 3 | ## Development 4 | 5 | This project is built and tested under the following environment. 6 | 7 | * OS: Mac OS X 10.10 8 | * IDE: Android Studio 1.2 9 | * JDK: 1.7 10 | 11 | ## Prerequisites for building on Android Studio 12 | 13 | * Android Studio (1.0.0+) 14 | * Oracle JDK 7 15 | * Android SDK Tools (Rev.24.1.2) 16 | * Android SDK Build-tools (Rev.22.0.1) 17 | * Android 5.1.1 SDK Platform (Rev.2) 18 | * Android Support Repository (Rev.14) 19 | * Android Support Library (Rev.21.1.1) 20 | 21 | ## Prerequisites for building on Eclipse 22 | 23 | * [Eclipse IDE for Java Developers 4.4 (Luna) SR1](https://eclipse.org/downloads/packages/eclipse-ide-java-developers/lunasr1a) 24 | * [Eclipse ADT Plugin](http://developer.android.com/sdk/installing/installing-adt.html) 25 | * Oracle JDK 7 26 | * Android 5.0 SDK Platform (Rev.1+) 27 | * Android Support Repository (Rev.9+) 28 | * Android Support Library (Rev.21.0.2+) 29 | -------------------------------------------------------------------------------- /library/src/androidTest/res/layout/activity_recyclerview.xml: -------------------------------------------------------------------------------- 1 | 16 | 20 | -------------------------------------------------------------------------------- /samples/res/layout/fragment_gridview.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | -------------------------------------------------------------------------------- /samples/res/layout/activity_handletouchgridview.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | -------------------------------------------------------------------------------- /website/public/_footer.ejs: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /library/src/androidTest/res/layout/fragment_gridview.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | -------------------------------------------------------------------------------- /samples/res/layout/activity_actionbarcontrolgridview.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | -------------------------------------------------------------------------------- /samples/res/layout/fragment_recyclerview.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | -------------------------------------------------------------------------------- /library/src/androidTest/res/layout/activity_gridview.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | -------------------------------------------------------------------------------- /library/src/androidTest/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 48dp 18 | 72dp 19 | 56dp 20 | 16dp 21 | 240dp 22 | 23 | -------------------------------------------------------------------------------- /library/src/androidTest/res/layout/fragment_recyclerview.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | -------------------------------------------------------------------------------- /website/public/_nav.ejs: -------------------------------------------------------------------------------- 1 | 21 | -------------------------------------------------------------------------------- /samples/res/layout/activity_actionbarcontrolrecyclerview.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | -------------------------------------------------------------------------------- /samples/res/layout/recycler_header.xml: -------------------------------------------------------------------------------- 1 | 16 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /samples/res/layout/fragment_fragmenttransition_second.xml: -------------------------------------------------------------------------------- 1 | 16 | 23 | -------------------------------------------------------------------------------- /samples/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 21 | 64dp 22 | 23 | 24 | -------------------------------------------------------------------------------- /website/public/css/_misc.less: -------------------------------------------------------------------------------- 1 | // Showing fragment links 2 | #sidebar-main-content { 3 | h2, h3, h4, h5 { 4 | position: relative; 5 | .anchor { 6 | visibility: hidden; 7 | padding-left: 4px; 8 | } 9 | &:hover { 10 | .anchor { 11 | visibility: visible; 12 | } 13 | } 14 | } 15 | .marker { 16 | position: absolute; 17 | top: -70px; 18 | left: 0; 19 | padding: 0; 20 | margin: 0; 21 | } 22 | h2 .anchor { 23 | font-size: 20px; 24 | } 25 | h3 .anchor { 26 | font-size: 16px; 27 | color: #212121; 28 | } 29 | h4 .anchor { 30 | font-size: 14px; 31 | color: #212121; 32 | } 33 | h5 .anchor { 34 | font-size: 12px; 35 | color: #212121; 36 | } 37 | img { 38 | -webkit-box-shadow: 0 2px 4px 2px rgba(0, 0, 0, 0.3); 39 | -moz-box-shadow: 0 2px 4px 2px rgba(0, 0, 0, 0.3); 40 | box-shadow: 0 2px 4px 2px rgba(0, 0, 0, 0.3); 41 | } 42 | a>img { 43 | -webkit-box-shadow: none; 44 | -moz-box-shadow: none; 45 | box-shadow: none; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /docs/quick-start/dependencies.md: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | 3 | This library is published to the Maven Central repository, so you can use it through Gradle/Maven. 4 | You can use it in Eclipse, but Android Studio (or Gradle) is recommended. 5 | In Quick start guide, we assume you're using Android Studio. 6 | 7 | ## build.gradle 8 | 9 | Write the following dependency configuration to your `build.gradle`. 10 | 11 | ```gradle 12 | repositories { 13 | mavenCentral() 14 | } 15 | 16 | dependencies { 17 | // Other dependencies are omitted 18 | compile 'com.github.ksoichiro:android-observablescrollview:VERSION' 19 | } 20 | ``` 21 | 22 | You should replace `VERSION` to the appropriate version number like `1.5.0`. 23 | 24 | Then, click "sync" button to get the library using the configuration above. 25 | 26 | To confirm the available versions, search [the Maven Central Repository](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.ksoichiro%22%20AND%20a%3A%22android-observablescrollview%22). 27 | 28 | [Next: Layout »](../../docs/quick-start/layout.md) 29 | -------------------------------------------------------------------------------- /website/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Android-ObservableScrollView", 3 | "description": "bower components for Android-ObservableScrollView", 4 | "dependencies": { 5 | "jquery": "1.11.2", 6 | "bootstrap": "3.3.4", 7 | "roboto-fontface": "0.4.0", 8 | "highlightjs": "8.5.0", 9 | "respond-minmax": "1.4.2", 10 | "html5shiv": "3.7.2", 11 | "octicons": "2.2.2" 12 | }, 13 | "overrides": { 14 | "jquery": { 15 | "main": "dist/*.min.*" 16 | }, 17 | "bootstrap": { 18 | "main": ["dist/css/*.min.css", "dist/js/*.min.js", "dist/fonts/*"] 19 | }, 20 | "roboto-fontface": { 21 | "main": ["fonts/Roboto-Thin*", "fonts/Roboto-Light*", "fonts/Roboto-Regular*"] 22 | }, 23 | "highlightjs": { 24 | "main": ["*.js"] 25 | }, 26 | "respond-minmax": { 27 | "main": "dest/*.min.js" 28 | }, 29 | "html5shiv": { 30 | "main": "dist/*.min.js" 31 | }, 32 | "octicons": { 33 | "main": ["octicons/*.css", "octicons/*.svg", "octicons/*.woff", "octicons/*.ttf", "octicons/*.eot"] 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /samples/res/layout/tab_indicator.xml: -------------------------------------------------------------------------------- 1 | 16 | -------------------------------------------------------------------------------- /library/src/androidTest/java/com/github/ksoichiro/android/observablescrollview/test/RecyclerViewScrollFromBottomActivity.java: -------------------------------------------------------------------------------- 1 | package com.github.ksoichiro.android.observablescrollview.test; 2 | 3 | import android.os.Bundle; 4 | 5 | import com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView; 6 | import com.github.ksoichiro.android.observablescrollview.ScrollUtils; 7 | 8 | public class RecyclerViewScrollFromBottomActivity extends RecyclerViewActivity { 9 | 10 | @Override 11 | protected void onCreate(Bundle savedInstanceState) { 12 | super.onCreate(savedInstanceState); 13 | final ObservableRecyclerView scrollable = (ObservableRecyclerView) findViewById(R.id.scrollable); 14 | ScrollUtils.addOnGlobalLayoutListener(scrollable, new Runnable() { 15 | @Override 16 | public void run() { 17 | int count = scrollable.getAdapter().getItemCount() - 1; 18 | int position = count == 0 ? 1 : count > 0 ? count : 0; 19 | scrollable.scrollToPosition(position); 20 | } 21 | }); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /library/src/androidTest/res/layout/tab_indicator.xml: -------------------------------------------------------------------------------- 1 | 16 | -------------------------------------------------------------------------------- /library/src/androidTest/java/com/github/ksoichiro/android/observablescrollview/test/ListViewScrollFromBottomActivity.java: -------------------------------------------------------------------------------- 1 | package com.github.ksoichiro.android.observablescrollview.test; 2 | 3 | import android.os.Bundle; 4 | 5 | import com.github.ksoichiro.android.observablescrollview.ObservableListView; 6 | import com.github.ksoichiro.android.observablescrollview.ScrollUtils; 7 | 8 | public class ListViewScrollFromBottomActivity extends ListViewActivity { 9 | 10 | @Override 11 | protected void onCreate(Bundle savedInstanceState) { 12 | super.onCreate(savedInstanceState); 13 | final ObservableListView scrollable = (ObservableListView) findViewById(R.id.scrollable); 14 | ScrollUtils.addOnGlobalLayoutListener(scrollable, new Runnable() { 15 | @Override 16 | public void run() { 17 | int count = scrollable.getAdapter().getCount() - 1; 18 | int position = count == 0 ? 1 : count > 0 ? count : 0; 19 | scrollable.smoothScrollToPosition(position); 20 | scrollable.setSelection(position); 21 | } 22 | }); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /samples/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 16 | 20 | 21 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /wercker.yml: -------------------------------------------------------------------------------- 1 | box: wercker/android 2 | # Build definition 3 | build: 4 | # The steps that will be executed on build 5 | steps: 6 | - script: 7 | name: show base information 8 | code: | 9 | ./gradlew -v 10 | echo $ANDROID_HOME 11 | echo $ANDROID_SDK_VERSION 12 | echo $ANDROID_BUILD_TOOLS 13 | echo $ANDROID_UPDATE_FILTER 14 | echo $ANDROID_NDK_HOME 15 | - android-sdk-update: 16 | filter: tools,platform-tools 17 | - android-sdk-update: 18 | filter: android-21,android-22,android-23,build-tools-23.0.2,extra-android-support,extra-android-m2repository 19 | # A step that executes `gradle build` command 20 | - script: 21 | name: run gradle 22 | code: | 23 | ./gradlew --full-stacktrace -q --project-cache-dir=$WERCKER_CACHE_DIR assembleDebug 24 | after-steps: 25 | - script: 26 | name: inspect build result 27 | code: | 28 | ls -la ./samples/build/outputs/apk 29 | cp ./samples/build/outputs/apk/*.apk $WERCKER_REPORT_ARTIFACTS_DIR 30 | rm -f $WERCKER_REPORT_ARTIFACTS_DIR/*-unaligned.apk 31 | -------------------------------------------------------------------------------- /website/public/css/_navbar.less: -------------------------------------------------------------------------------- 1 | .navbar-shadow() { 2 | @shadow-h-offset: 0px; 3 | @shadow-v-offset: -3px; 4 | @shadow-blur-radius: 6px; 5 | @shadow-spread-radius: 6px; 6 | @shadow-color: rgba(32, 32, 32, 0.4); 7 | -moz-box-shadow: @shadow-h-offset @shadow-v-offset @shadow-blur-radius @shadow-spread-radius @shadow-color; 8 | -webkit-box-shadow: @shadow-h-offset @shadow-v-offset @shadow-blur-radius @shadow-spread-radius @shadow-color; 9 | box-shadow: @shadow-h-offset @shadow-v-offset @shadow-blur-radius @shadow-spread-radius @shadow-color; 10 | } 11 | .navbar-shadow-clear() { 12 | -moz-box-shadow: none; 13 | -webkit-box-shadow: none; 14 | box-shadow: none; 15 | } 16 | 17 | nav.navbar { 18 | .navbar-shadow(); 19 | .navbar-brand { 20 | background-image: url('../images/logo.svg'); 21 | background-repeat: no-repeat; 22 | background-position: 12px center; 23 | padding-left: 64px; 24 | } 25 | } 26 | 27 | @media screen and (max-width: 767px) { 28 | nav.navbar { 29 | .navbar-brand { 30 | background-position: 4px center; 31 | padding-left: 56px; 32 | padding-right: 8px; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /library/src/androidTest/java/com/github/ksoichiro/android/observablescrollview/test/ScrollUtilsTest.java: -------------------------------------------------------------------------------- 1 | package com.github.ksoichiro.android.observablescrollview.test; 2 | 3 | import android.graphics.Color; 4 | import android.test.InstrumentationTestCase; 5 | 6 | import com.github.ksoichiro.android.observablescrollview.ScrollUtils; 7 | 8 | import junit.framework.Assert; 9 | 10 | public class ScrollUtilsTest extends InstrumentationTestCase { 11 | 12 | public void testGetFloat() { 13 | Assert.assertEquals(1.0f, ScrollUtils.getFloat(1, 0, 2)); 14 | assertEquals(0.0f, ScrollUtils.getFloat(-1, 0, 2)); 15 | assertEquals(2.0f, ScrollUtils.getFloat(3, 0, 2)); 16 | } 17 | 18 | public void testGetColorWithAlpha() { 19 | assertEquals(Color.parseColor("#00123456"), ScrollUtils.getColorWithAlpha(0, Color.parseColor("#FF123456"))); 20 | assertEquals(Color.parseColor("#FF123456"), ScrollUtils.getColorWithAlpha(1, Color.parseColor("#FF123456"))); 21 | } 22 | 23 | public void testMixColors() { 24 | assertEquals(Color.parseColor("#000000"), ScrollUtils.mixColors(Color.parseColor("#000000"), Color.parseColor("#FFFFFF"), 0)); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /samples/res/layout-v11/tab_indicator.xml: -------------------------------------------------------------------------------- 1 | 16 | -------------------------------------------------------------------------------- /library/src/androidTest/res/layout/activity_scrollview.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 22 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /library/src/androidTest/java/com/github/ksoichiro/android/observablescrollview/test/ScrollViewActivity.java: -------------------------------------------------------------------------------- 1 | package com.github.ksoichiro.android.observablescrollview.test; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | 6 | import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; 7 | import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks; 8 | import com.github.ksoichiro.android.observablescrollview.ScrollState; 9 | import com.github.ksoichiro.android.observablescrollview.Scrollable; 10 | 11 | public class ScrollViewActivity extends Activity implements ObservableScrollViewCallbacks { 12 | 13 | @Override 14 | protected void onCreate(Bundle savedInstanceState) { 15 | super.onCreate(savedInstanceState); 16 | setContentView(R.layout.activity_scrollview); 17 | ((Scrollable) findViewById(R.id.scrollable)).setScrollViewCallbacks(this); 18 | } 19 | 20 | @Override 21 | public void onScrollChanged(int scrollY, boolean firstScroll, boolean dragging) { 22 | } 23 | 24 | @Override 25 | public void onDownMotionEvent() { 26 | } 27 | 28 | @Override 29 | public void onUpOrCancelMotionEvent(ScrollState scrollState) { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /library/src/main/java/com/github/ksoichiro/android/observablescrollview/ScrollState.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Soichiro Kashima 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.github.ksoichiro.android.observablescrollview; 18 | 19 | /** 20 | * Constants that indicates the scroll state of the Scrollable widgets. 21 | */ 22 | public enum ScrollState { 23 | /** 24 | * Widget is stopped. 25 | * This state does not always mean that this widget have never been scrolled. 26 | */ 27 | STOP, 28 | 29 | /** 30 | * Widget is scrolled up by swiping it down. 31 | */ 32 | UP, 33 | 34 | /** 35 | * Widget is scrolled down by swiping it up. 36 | */ 37 | DOWN, 38 | } 39 | -------------------------------------------------------------------------------- /website/public/css/_colors.less: -------------------------------------------------------------------------------- 1 | @theme-main-color: #009688; // 500 2 | @theme-focus-color: #00897B; // 600 3 | @theme-brand-color: #E0F2F1; // 50 4 | @theme-focus-border-color: #00695C; // 800 5 | @theme-active-color: #00695C; // 800 6 | .navbar-inverse { 7 | background-color: @theme-main-color; 8 | border-color: @theme-main-color; 9 | .navbar-brand, 10 | .navbar-nav>li>a { 11 | color: @theme-brand-color; 12 | } 13 | .navbar-nav>.active>a, 14 | .navbar-nav>.active>a:focus, 15 | .navbar-nav>.active>a:hover { 16 | background-color: @theme-active-color; 17 | } 18 | .navbar-nav>.open>a, 19 | .navbar-nav>.open>a:focus, 20 | .navbar-nav>.open>a:hover { 21 | background-color: @theme-focus-color; 22 | } 23 | .navbar-toggle { 24 | background-color: @theme-main-color; 25 | } 26 | .navbar-toggle { 27 | border-color: @theme-focus-border-color; 28 | &:hover, 29 | &:focus { 30 | background-color: @theme-focus-color; 31 | } 32 | } 33 | .navbar-collapse { 34 | border-color: @theme-focus-border-color; 35 | } 36 | } 37 | code { 38 | color: @theme-main-color; 39 | background-color: lighten(@theme-brand-color, 7%); 40 | } 41 | a, 42 | a:hover { 43 | color: @theme-main-color; 44 | } 45 | a:hover { 46 | text-decoration: none; 47 | } 48 | h1, h2 { 49 | color: @theme-main-color; 50 | } 51 | -------------------------------------------------------------------------------- /library/src/androidTest/java/com/github/ksoichiro/android/observablescrollview/test/ListViewScrollFromBottomActivityTest.java: -------------------------------------------------------------------------------- 1 | package com.github.ksoichiro.android.observablescrollview.test; 2 | 3 | import android.app.Activity; 4 | import android.test.ActivityInstrumentationTestCase2; 5 | 6 | import com.github.ksoichiro.android.observablescrollview.ObservableListView; 7 | 8 | public class ListViewScrollFromBottomActivityTest extends ActivityInstrumentationTestCase2 { 9 | 10 | private Activity activity; 11 | private ObservableListView scrollable; 12 | 13 | public ListViewScrollFromBottomActivityTest() { 14 | super(ListViewScrollFromBottomActivity.class); 15 | } 16 | 17 | @Override 18 | protected void setUp() throws Exception { 19 | super.setUp(); 20 | setActivityInitialTouchMode(true); 21 | activity = getActivity(); 22 | scrollable = (ObservableListView) activity.findViewById(R.id.scrollable); 23 | } 24 | 25 | public void testScroll() throws Throwable { 26 | UiTestUtils.swipeVertically(this, scrollable, UiTestUtils.Direction.DOWN); 27 | getInstrumentation().waitForIdleSync(); 28 | 29 | UiTestUtils.swipeVertically(this, scrollable, UiTestUtils.Direction.UP); 30 | getInstrumentation().waitForIdleSync(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /samples/src/main/java/com/github/ksoichiro/android/observablescrollview/samples/ToolbarControlScrollViewActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Soichiro Kashima 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.github.ksoichiro.android.observablescrollview.samples; 18 | 19 | import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; 20 | 21 | public class ToolbarControlScrollViewActivity extends ToolbarControlBaseActivity { 22 | 23 | @Override 24 | protected int getLayoutResId() { 25 | return R.layout.activity_toolbarcontrolscrollview; 26 | } 27 | 28 | @Override 29 | protected ObservableScrollView createScrollable() { 30 | return (ObservableScrollView) findViewById(R.id.scrollable); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /website/public/css/_code.less: -------------------------------------------------------------------------------- 1 | // Based on androidstudio.css 2 | // made by Author: Pedro Oliveira 3 | 4 | @code-bg-color: #263238; // Blue Grey 900 5 | pre { 6 | border-width: 0px; 7 | border-radius: 0px; 8 | background: @code-bg-color; 9 | @code-bg-shadow-alpha: 0.6; 10 | -webkit-box-shadow: 0 4px 6px 2px rgba(24, 24, 24, @code-bg-shadow-alpha) inset; 11 | -moz-box-shadow: 0 4px 6px 2px rgba(24, 24, 24, @code-bg-shadow-alpha) inset; 12 | box-shadow: 0 4px 6px 2px rgba(24, 24, 24, @code-bg-shadow-alpha) inset; 13 | } 14 | .nohighlight, 15 | .hljs { 16 | color: #A9B7C6; 17 | background: @code-bg-color; 18 | display: block; 19 | overflow-x: auto; 20 | padding: 12px; 21 | webkit-text-size-adjust: none; 22 | } 23 | .hljs-number { 24 | color: #6897BB; 25 | } 26 | 27 | .hljs-keyword, .hljs-deletion { 28 | color: #CC7832; 29 | } 30 | .hljs-javadoc { 31 | color: #629755; 32 | } 33 | .hljs-comment { 34 | color: #808080; 35 | } 36 | .hljs-annotation { 37 | color: #BBB529; 38 | } 39 | .hljs-string, .hljs-addition { 40 | color: #6A8759; 41 | } 42 | .hljs-function .hljs-title, .hljs-change { 43 | color: #FFC66D; 44 | } 45 | .hljs-tag .hljs-title, .hljs-doctype { 46 | color: #E8BF6A; 47 | } 48 | .hljs-tag .hljs-attribute { 49 | color: #BABABA; 50 | } 51 | .hljs-tag .hljs-value { 52 | color: #A5C261; 53 | } 54 | -------------------------------------------------------------------------------- /library/src/androidTest/java/com/github/ksoichiro/android/observablescrollview/test/WebViewActivity.java: -------------------------------------------------------------------------------- 1 | package com.github.ksoichiro.android.observablescrollview.test; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | 6 | import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks; 7 | import com.github.ksoichiro.android.observablescrollview.ObservableWebView; 8 | import com.github.ksoichiro.android.observablescrollview.ScrollState; 9 | import com.github.ksoichiro.android.observablescrollview.Scrollable; 10 | 11 | public class WebViewActivity extends Activity implements ObservableScrollViewCallbacks { 12 | 13 | @Override 14 | protected void onCreate(Bundle savedInstanceState) { 15 | super.onCreate(savedInstanceState); 16 | setContentView(R.layout.activity_webview); 17 | ObservableWebView scrollable = (ObservableWebView) findViewById(R.id.scrollable); 18 | scrollable.setScrollViewCallbacks(this); 19 | scrollable.loadUrl("file:///android_asset/lipsum.html"); 20 | } 21 | 22 | @Override 23 | public void onScrollChanged(int scrollY, boolean firstScroll, boolean dragging) { 24 | } 25 | 26 | @Override 27 | public void onDownMotionEvent() { 28 | } 29 | 30 | @Override 31 | public void onUpOrCancelMotionEvent(ScrollState scrollState) { 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /docs/example/wercker.md: -------------------------------------------------------------------------------- 1 | # Download from wercker 2 | 3 | [wercker](http://wercker.com/) is a CI service and this project uses wercker to provide the latest sample apk. 4 | If you're not interested in this, go to the next topic. 5 | 6 | ## Login to wercker 7 | 8 | At first, you need to be a member of [wercker](http://wercker.com/) and should login before download the app. 9 | 10 | ## Visit this repository 11 | 12 | Click the badge below to show this repository's builds. 13 | 14 | [![wercker status](https://app.wercker.com/status/8d1e27d9f4a662b25dbe70402733582b/m/master "wercker status")](https://app.wercker.com/project/bykey/8d1e27d9f4a662b25dbe70402733582b) 15 | 16 | ## Select the build 17 | 18 | Then select the commit link that you want to download. 19 | Note that green check mark in front of the link means successful builds and red ones are failure, 20 | and you can only download the app from the green ones. 21 | 22 | ![](../images/wercker_1.png) 23 | 24 | ## Open the last section 25 | 26 | Scroll the screen, and click anywhere in the "inspect build result" section to open it. 27 | 28 | ![](../images/wercker_2.png) 29 | 30 | ## Download the artifact 31 | 32 | Finally, you can download the apk file by clicking the `artifact.tar.gz` link. 33 | 34 | ![](../images/wercker_3.png) 35 | 36 | [Next: Build on Android Studio »](../../docs/example/android-studio.md) 37 | -------------------------------------------------------------------------------- /samples/res/layout/fragment_flexiblespacewithimagelistview.xml: -------------------------------------------------------------------------------- 1 | 16 | 20 | 21 | 26 | 27 | 32 | 33 | -------------------------------------------------------------------------------- /docs/overview.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | 3 | Android-ObservableScrollView is a library to handle scroll position for Android apps, and contains lots of examples to demonstrate how this library works. 4 | 5 | However, creating awesome scrolling effects depends deeply on how you use it: layout, offset calculation to animate views, etc. 6 | 7 | This documentation describes how to install this library and apply to your application. 8 | 9 | ## Get started 10 | 11 | See [quick start](../docs/quick-start/index.md) section. 12 | 13 | ## See the complete examples 14 | 15 | You can try the example app, to see what this library can do. 16 | See [try the example app](../docs/example/index.md) section to know how to install the app. 17 | 18 | ## Learn from basics 19 | 20 | Now you must have seen the examples and setup your environments, then let's learn how to use it in your app. 21 | See [basic techniques](../docs/basic/index.md) section. 22 | 23 | ## Challenge complex and awesome techniques 24 | 25 | If you'd like to create complex, awesome scrolling animation using ViewPager or something, 26 | please check out [advanced techniques](../docs/advanced/index.md) section. 27 | 28 | ## If you're interested in improving this library... 29 | 30 | Please see the [contribution guideline](../CONTRIBUTING.md). 31 | Also, [for contributiors](../docs/contributor/index.md) section will be useful to understand / manage the entire project. 32 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Thank you for your contribution! 2 | 3 | Any contributions will be greatly appreciated. 4 | 5 | Before submitting a new issue, please check the following guideline. 6 | 7 | ## Describe your issue as much as possible 8 | 9 | The library itself only provides the scroll information, 10 | and creating awesome scrolling effects depends deeply on how you use it: layout, offset calculation to animate views, etc. 11 | 12 | Therefore, if you find an issue, please describe not only the issue itself but also the following information: 13 | 14 | ### If you find it in the sample app of this project 15 | 16 | * Required 17 | * Activity name 18 | * Operation to produce the issue 19 | * Modified code 20 | * If you modified some codes in the sample, it should be described with modified codes 21 | * Preferred 22 | * Version (git commit hash) of the codes 23 | * Android OS version 24 | * device 25 | * Nexus5, x86 emulator, etc. 26 | 27 | ### If you find it in your app 28 | 29 | * Required 30 | * Operation to produce the issue 31 | * Related code 32 | * Without the related codes, I can't say anything. 33 | Screenshot / movie is useful to understand the issue, 34 | but not enough to discuss the cause of the issue. 35 | * Preferred 36 | * Version of the library 37 | * Android OS version 38 | * device 39 | * Nexus5, x86 emulator, etc. 40 | -------------------------------------------------------------------------------- /samples/src/main/java/com/github/ksoichiro/android/observablescrollview/samples/ToolbarControlGridViewActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Soichiro Kashima 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.github.ksoichiro.android.observablescrollview.samples; 18 | 19 | import com.github.ksoichiro.android.observablescrollview.ObservableGridView; 20 | 21 | public class ToolbarControlGridViewActivity extends ToolbarControlBaseActivity { 22 | 23 | @Override 24 | protected int getLayoutResId() { 25 | return R.layout.activity_toolbarcontrolgridview; 26 | } 27 | 28 | @Override 29 | protected ObservableGridView createScrollable() { 30 | ObservableGridView gridView = (ObservableGridView) findViewById(R.id.scrollable); 31 | setDummyData(gridView); 32 | return gridView; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /samples/res/layout/fragment_flexiblespacewithimagegridview.xml: -------------------------------------------------------------------------------- 1 | 16 | 20 | 21 | 26 | 27 | 33 | 34 | -------------------------------------------------------------------------------- /samples/src/main/java/com/github/ksoichiro/android/observablescrollview/samples/ToolbarControlWebViewActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Soichiro Kashima 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.github.ksoichiro.android.observablescrollview.samples; 18 | 19 | import com.github.ksoichiro.android.observablescrollview.ObservableWebView; 20 | 21 | public class ToolbarControlWebViewActivity extends ToolbarControlBaseActivity { 22 | 23 | @Override 24 | protected int getLayoutResId() { 25 | return R.layout.activity_toolbarcontrolwebview; 26 | } 27 | 28 | @Override 29 | protected ObservableWebView createScrollable() { 30 | ObservableWebView webView = (ObservableWebView) findViewById(R.id.scrollable); 31 | webView.loadUrl("file:///android_asset/lipsum.html"); 32 | return webView; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /samples/src/main/java/com/github/ksoichiro/android/observablescrollview/samples/FillGap2BaseActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Soichiro Kashima 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.github.ksoichiro.android.observablescrollview.samples; 18 | 19 | import com.github.ksoichiro.android.observablescrollview.ScrollUtils; 20 | import com.github.ksoichiro.android.observablescrollview.Scrollable; 21 | 22 | /** 23 | * Almost same as FillGapBaseActivity, 24 | * but in this activity, when swiping up, the filled space shrinks 25 | * and the header bar moves to the top. 26 | */ 27 | public abstract class FillGap2BaseActivity extends FillGapBaseActivity { 28 | protected float getHeaderTranslationY(int scrollY) { 29 | return ScrollUtils.getFloat(-scrollY + mFlexibleSpaceImageHeight - mHeaderBar.getHeight(), 0, Float.MAX_VALUE); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /library/src/androidTest/java/com/github/ksoichiro/android/observablescrollview/test/RecyclerViewScrollFromBottomActivityTest.java: -------------------------------------------------------------------------------- 1 | package com.github.ksoichiro.android.observablescrollview.test; 2 | 3 | import android.app.Activity; 4 | import android.test.ActivityInstrumentationTestCase2; 5 | 6 | import com.github.ksoichiro.android.observablescrollview.ObservableListView; 7 | import com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView; 8 | 9 | public class RecyclerViewScrollFromBottomActivityTest extends ActivityInstrumentationTestCase2 { 10 | 11 | private Activity activity; 12 | private ObservableRecyclerView scrollable; 13 | 14 | public RecyclerViewScrollFromBottomActivityTest() { 15 | super(RecyclerViewScrollFromBottomActivity.class); 16 | } 17 | 18 | @Override 19 | protected void setUp() throws Exception { 20 | super.setUp(); 21 | setActivityInitialTouchMode(true); 22 | activity = getActivity(); 23 | scrollable = (ObservableRecyclerView) activity.findViewById(R.id.scrollable); 24 | } 25 | 26 | public void testScroll() throws Throwable { 27 | UiTestUtils.swipeVertically(this, scrollable, UiTestUtils.Direction.DOWN); 28 | getInstrumentation().waitForIdleSync(); 29 | 30 | UiTestUtils.swipeVertically(this, scrollable, UiTestUtils.Direction.UP); 31 | getInstrumentation().waitForIdleSync(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /docs/_layout.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | <%- partial("../_head", { title: title, ogType: "article" }) %> 5 | 6 | 7 | 8 | <%- partial("../_nav") %> 9 | 10 |
11 |

12 | 13 |

14 |
15 | 33 |
34 | <%- yield %> 35 |
36 |
37 |
38 | 39 | <%- partial("../_footer") %> 40 | 41 | 42 | -------------------------------------------------------------------------------- /samples/res/layout/activity_viewpagertabfragment.xml: -------------------------------------------------------------------------------- 1 | 16 | 20 | 21 | 25 | 26 | 34 | 35 | -------------------------------------------------------------------------------- /library/src/androidTest/java/com/github/ksoichiro/android/observablescrollview/test/RecyclerViewActivity.java: -------------------------------------------------------------------------------- 1 | package com.github.ksoichiro.android.observablescrollview.test; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.support.v7.widget.LinearLayoutManager; 6 | 7 | import com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView; 8 | import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks; 9 | import com.github.ksoichiro.android.observablescrollview.ScrollState; 10 | 11 | public class RecyclerViewActivity extends Activity implements ObservableScrollViewCallbacks { 12 | 13 | @Override 14 | protected void onCreate(Bundle savedInstanceState) { 15 | super.onCreate(savedInstanceState); 16 | setContentView(R.layout.activity_recyclerview); 17 | 18 | ObservableRecyclerView recyclerView = (ObservableRecyclerView) findViewById(R.id.scrollable); 19 | recyclerView.setLayoutManager(new LinearLayoutManager(this)); 20 | recyclerView.setHasFixedSize(true); 21 | recyclerView.setScrollViewCallbacks(this); 22 | UiTestUtils.setDummyData(this, recyclerView); 23 | } 24 | 25 | @Override 26 | public void onScrollChanged(int scrollY, boolean firstScroll, boolean dragging) { 27 | } 28 | 29 | @Override 30 | public void onDownMotionEvent() { 31 | } 32 | 33 | @Override 34 | public void onUpOrCancelMotionEvent(ScrollState scrollState) { 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /website/public/index.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | <%- partial("_head") %> 5 | 6 | 7 | 8 | 28 | 29 |
30 |
31 |

<%- title %>

32 |
33 |
34 | 35 |
36 |
37 | 38 |
39 | <%- partial('../../README') %> 40 |
41 |
42 |
43 | 44 | <%- partial("_footer") %> 45 | 46 | 47 | -------------------------------------------------------------------------------- /samples/res/layout/activity_actionbarcontrolscrollview.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 22 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /library/src/androidTest/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 23 | 24 | 29 | 30 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /website/public/css/_sidebar.less: -------------------------------------------------------------------------------- 1 | @import (reference) '../../bower_components/bootstrap/less/bootstrap.less'; 2 | 3 | // Page with sidebar 4 | .btn-sidebar-toggle { 5 | .btn; 6 | .btn-default; 7 | .btn-xs; 8 | } 9 | #grid-content { 10 | .make-row(); 11 | #sidebar { 12 | .make-xs-column(6); 13 | .make-sm-column(3); 14 | 15 | ul { 16 | padding-left: 0px; 17 | } 18 | &>ul { 19 | border-right: 1px solid #E0E0E0; 20 | padding-right: 15px; 21 | li { 22 | position: relative; 23 | display: block; 24 | } 25 | &>li { 26 | padding: 8px; 27 | } 28 | .section { 29 | font-size: 14px; 30 | font-weight: 400; 31 | margin: 0px; 32 | margin-bottom: 8px; 33 | &, 34 | &>a { 35 | color: #009688; 36 | text-decoration: none; 37 | } 38 | } 39 | .topic { 40 | &>a { 41 | color: #212121; 42 | } 43 | } 44 | } 45 | } 46 | #sidebar-main-content { 47 | .make-xs-column(12); 48 | .make-sm-column(9); 49 | } 50 | } 51 | 52 | @media screen and (max-width: 767px) { 53 | #grid-content { 54 | position: relative; 55 | -webkit-transition: all .25s ease-out; 56 | -o-transition: all .25s ease-out; 57 | transition: all .25s ease-out; 58 | left: 0; 59 | 60 | &.active { 61 | left: 50%; 62 | } 63 | 64 | #sidebar { 65 | left: -50%; 66 | position: absolute; 67 | top: 0; 68 | width: 50%; 69 | } 70 | } 71 | } 72 | 73 | -------------------------------------------------------------------------------- /samples/src/main/java/com/github/ksoichiro/android/observablescrollview/samples/SlidingUpScrollViewActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Soichiro Kashima 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.github.ksoichiro.android.observablescrollview.samples; 18 | 19 | import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; 20 | import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks; 21 | 22 | public class SlidingUpScrollViewActivity extends SlidingUpBaseActivity implements ObservableScrollViewCallbacks { 23 | 24 | @Override 25 | protected int getLayoutResId() { 26 | return R.layout.activity_slidingupscrollview; 27 | } 28 | 29 | @Override 30 | protected ObservableScrollView createScrollable() { 31 | ObservableScrollView scrollView = (ObservableScrollView) findViewById(R.id.scroll); 32 | scrollView.setScrollViewCallbacks(this); 33 | return scrollView; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /library/src/androidTest/res/layout/fragment_scrollview_noheader.xml: -------------------------------------------------------------------------------- 1 | 16 | 23 | 24 | 28 | 29 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /website/public/css/_roboto-fonts.less: -------------------------------------------------------------------------------- 1 | @roboto-font-path: '../lib/roboto-fontface/fonts'; 2 | 3 | .roboto-font(@type, @weight, @style) { 4 | @font-face { 5 | font-family: 'Roboto'; 6 | src: url('@{roboto-font-path}/Roboto-@{type}.eot'); 7 | src: url('@{roboto-font-path}/Roboto-@{type}.eot?#iefix') format('embedded-opentype'), 8 | url('@{roboto-font-path}/Roboto-@{type}.woff2') format('woff2'), 9 | url('@{roboto-font-path}/Roboto-@{type}.woff') format('woff'), 10 | url('@{roboto-font-path}/Roboto-@{type}.ttf') format('truetype'), 11 | url('@{roboto-font-path}/Roboto-@{type}.svg#Roboto') format('svg'); 12 | font-weight: @weight; 13 | font-style: @style; 14 | } 15 | 16 | @font-face { 17 | font-family: 'Roboto-@{type}'; 18 | src: url('@{roboto-font-path}/Roboto-@{type}.eot'); 19 | src: url('@{roboto-font-path}/Roboto-@{type}.eot?#iefix') format('embedded-opentype'), 20 | url('@{roboto-font-path}/Roboto-@{type}.woff2') format('woff2'), 21 | url('@{roboto-font-path}/Roboto-@{type}.woff') format('woff'), 22 | url('@{roboto-font-path}/Roboto-@{type}.ttf') format('truetype'), 23 | url('@{roboto-font-path}/Roboto-@{type}.svg#Roboto') format('svg'); 24 | } 25 | } 26 | 27 | .roboto-font-pair(@type, @weight) { 28 | .roboto-font('@{type}', @weight, normal); 29 | .roboto-font('@{type}Italic', @weight, italic); 30 | } 31 | 32 | .roboto-font-pair('Thin', 100); 33 | .roboto-font-pair('Light', 300); 34 | .roboto-font-pair('Regular', 400); 35 | -------------------------------------------------------------------------------- /samples/src/main/java/com/github/ksoichiro/android/observablescrollview/samples/SlidingUpWebViewActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Soichiro Kashima 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.github.ksoichiro.android.observablescrollview.samples; 18 | 19 | import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks; 20 | import com.github.ksoichiro.android.observablescrollview.ObservableWebView; 21 | 22 | public class SlidingUpWebViewActivity extends SlidingUpBaseActivity implements ObservableScrollViewCallbacks { 23 | 24 | @Override 25 | protected int getLayoutResId() { 26 | return R.layout.activity_slidingupwebview; 27 | } 28 | 29 | @Override 30 | protected ObservableWebView createScrollable() { 31 | ObservableWebView webView = (ObservableWebView) findViewById(R.id.scroll); 32 | webView.setScrollViewCallbacks(this); 33 | webView.loadUrl("file:///android_asset/lipsum.html"); 34 | return webView; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /library/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | dependencies { 4 | compile 'com.android.support:recyclerview-v7:23.1.1' 5 | androidTestCompile ('com.android.support:appcompat-v7:23.1.1') { 6 | exclude module: 'support-v4' 7 | } 8 | androidTestCompile ('com.nineoldandroids:library:2.4.0') { 9 | exclude module: 'support-v4' 10 | } 11 | } 12 | 13 | android { 14 | compileSdkVersion 23 15 | buildToolsVersion "23.0.2" 16 | 17 | defaultConfig { 18 | minSdkVersion 9 19 | } 20 | 21 | buildTypes { 22 | debug { 23 | testCoverageEnabled = true 24 | } 25 | } 26 | 27 | sourceSets { 28 | main { 29 | manifest.srcFile 'AndroidManifest.xml' 30 | res.srcDirs = ['res'] 31 | } 32 | } 33 | 34 | lintOptions { 35 | abortOnError false 36 | } 37 | } 38 | 39 | // When testing on Travis CI, 40 | // connectedCheck task doesn't output logs for more than 10 minutes often, 41 | // which causes build failure. 42 | // To avoid this, we change the log level for test tasks. 43 | // Test tasks for buildTypes will be defined on evaluation phase, 44 | // so do it on afterEvaluate. 45 | afterEvaluate { project -> 46 | tasks.withType(VerificationTask) { 47 | logging.level = LogLevel.INFO 48 | } 49 | } 50 | 51 | apply plugin: 'com.github.kt3k.coveralls' 52 | 53 | coveralls.jacocoReportPath = 'build/reports/coverage/debug/report.xml' 54 | 55 | // This is from 'https://github.com/chrisbanes/gradle-mvn-push' 56 | apply from: "${rootDir}/gradle/gradle-mvn-push.gradle" 57 | -------------------------------------------------------------------------------- /samples/res/layout/activity_toolbarcontrolwebview.xml: -------------------------------------------------------------------------------- 1 | 16 | 20 | 21 | 29 | 30 | 35 | 36 | -------------------------------------------------------------------------------- /samples/res/layout/list_item_main.xml: -------------------------------------------------------------------------------- 1 | 16 | 23 | 24 | 30 | 31 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /samples/res/layout/activity_toolbarcontrollistview.xml: -------------------------------------------------------------------------------- 1 | 16 | 20 | 21 | 29 | 30 | 35 | 36 | -------------------------------------------------------------------------------- /samples/res/layout/activity_fragmenttransition.xml: -------------------------------------------------------------------------------- 1 | 16 | 21 | 22 | 31 | 32 | 37 | 38 | -------------------------------------------------------------------------------- /samples/res/layout/activity_toolbarcontrolrecyclerview.xml: -------------------------------------------------------------------------------- 1 | 16 | 20 | 21 | 29 | 30 | 35 | 36 | -------------------------------------------------------------------------------- /library/src/androidTest/res/layout/fragment_scrollview.xml: -------------------------------------------------------------------------------- 1 | 16 | 23 | 24 | 28 | 29 | 30 | 31 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /samples/src/main/java/com/github/ksoichiro/android/observablescrollview/samples/FillGap2ScrollViewActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Soichiro Kashima 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.github.ksoichiro.android.observablescrollview.samples; 18 | 19 | import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; 20 | import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks; 21 | 22 | /** 23 | * Warning: This example does not work on Android 2.3. 24 | */ 25 | public class FillGap2ScrollViewActivity extends FillGap2BaseActivity implements ObservableScrollViewCallbacks { 26 | @Override 27 | protected int getLayoutResId() { 28 | return R.layout.activity_fillgapscrollview; 29 | } 30 | 31 | @Override 32 | protected ObservableScrollView createScrollable() { 33 | ObservableScrollView scrollView = (ObservableScrollView) findViewById(R.id.scroll); 34 | scrollView.setScrollViewCallbacks(this); 35 | return scrollView; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /samples/src/main/java/com/github/ksoichiro/android/observablescrollview/samples/FillGap3ScrollViewActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Soichiro Kashima 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.github.ksoichiro.android.observablescrollview.samples; 18 | 19 | import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; 20 | import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks; 21 | 22 | /** 23 | * Warning: This example does not work on Android 2.3. 24 | */ 25 | public class FillGap3ScrollViewActivity extends FillGap3BaseActivity implements ObservableScrollViewCallbacks { 26 | @Override 27 | protected int getLayoutResId() { 28 | return R.layout.activity_fillgap3scrollview; 29 | } 30 | 31 | @Override 32 | protected ObservableScrollView createScrollable() { 33 | ObservableScrollView scrollView = (ObservableScrollView) findViewById(R.id.scroll); 34 | scrollView.setScrollViewCallbacks(this); 35 | return scrollView; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /samples/src/main/java/com/github/ksoichiro/android/observablescrollview/samples/FillGapScrollViewActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Soichiro Kashima 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.github.ksoichiro.android.observablescrollview.samples; 18 | 19 | import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; 20 | import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks; 21 | 22 | /** 23 | * Warning: This example does not work on Android 2.3. 24 | */ 25 | public class FillGapScrollViewActivity extends FillGapBaseActivity implements ObservableScrollViewCallbacks { 26 | @Override 27 | protected int getLayoutResId() { 28 | return R.layout.activity_fillgapscrollview; 29 | } 30 | 31 | @Override 32 | protected ObservableScrollView createScrollable() { 33 | ObservableScrollView scrollView = (ObservableScrollView) findViewById(R.id.scroll); 34 | scrollView.setScrollViewCallbacks(this); 35 | return scrollView; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /samples/res/layout/activity_toolbarcontrolgridview.xml: -------------------------------------------------------------------------------- 1 | 16 | 20 | 21 | 29 | 30 | 36 | 37 | -------------------------------------------------------------------------------- /samples/src/main/java/com/github/ksoichiro/android/observablescrollview/samples/ToolbarControlRecyclerViewActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014 Soichiro Kashima 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.github.ksoichiro.android.observablescrollview.samples; 18 | 19 | import android.support.v7.widget.LinearLayoutManager; 20 | 21 | import com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView; 22 | 23 | public class ToolbarControlRecyclerViewActivity extends ToolbarControlBaseActivity { 24 | 25 | @Override 26 | protected int getLayoutResId() { 27 | return R.layout.activity_toolbarcontrolrecyclerview; 28 | } 29 | 30 | @Override 31 | protected ObservableRecyclerView createScrollable() { 32 | ObservableRecyclerView recyclerView = (ObservableRecyclerView) findViewById(R.id.scrollable); 33 | recyclerView.setLayoutManager(new LinearLayoutManager(this)); 34 | recyclerView.setHasFixedSize(true); 35 | setDummyData(recyclerView); 36 | return recyclerView; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /samples/res/layout/list_item_handletouch.xml: -------------------------------------------------------------------------------- 1 | 16 | 23 | 24 | 31 | 32 |