smooth-app-bar-layout
The issue that is addressed in this library is fixed from support design 26.0.0 or above (finally). Please use support design instead.
Installation
Example: if the latest support design version is 24.1.0
and SmoothAppBarLayout fix is 0
, please use compile "me.henrytao:smooth-app-bar-layout:24.1.0.0"
. Please check TAGS
section to see all supported versions.
smooth-app-bar-layout
is an UI library and pretty much depended on AppCompat and Support Design. So that, versioning is quite the same with those libraries from Google.smooth-app-bar-layout
is deployed tojCenter
. Make sure you havejcenter()
in your project gradle.
Tested environments
"com.android.support:design:23.1.1"
"com.android.support:appcompat-v7:23.1.1"
Demo
Please note that the app on the Play store is not always the latest version.
Concepts
Features
- Scroll
- EnterAlways
- EnterAlwaysCollapsed
- ExitUntilCollapsed
- QuickReturn
- Custom NestedScrollView (NEW)
- ViewPager Scroll
- ViewPager ExitUntilCollapsed (NEW)
- ViewPager QuickReturn (NEW)
- Support SwipeRefreshLayout
Checkout these demo videos:
- Google Design Support AppBarLayout: https://youtu.be/oaN2UTZIRUk
- SmoothAppBarLayout: https://youtu.be/la6ixCL9RKs
Important Notes
- Remember to set
android:id
forme.henrytao.smoothappbarlayout.SmoothAppBarLayout
in layout file so that it can callonSaveInstanceState
andonRestoreInstanceState
correctly. Otherwise, it won't work correctly withonOrientationChanged
. - Remember to set
android:minHeight
forme.henrytao.smoothappbarlayout.SmoothAppBarLayout
in layout file if you useViewPager
. clipToPadding
inRecyclerView
won't work. You have to set HeaderHolder in apdater and it has to be placed at index 0.
Usage
Super easy! Just need to do 3 steps:
- Change
android.support.design.widget.AppBarLayout
tome.henrytao.smoothappbarlayout.SmoothAppBarLayout
and setandroid:id
- Remove
app:layout_behavior="@string/appbar_scrolling_view_behavior"
. - Add header to your NestedScrollView or RecyclerView.