In version 5 of Google Play Store app, scroll to the content, ActionBar on with scrolling, but the tabs are fixed to get on top.
How to do this?
BEFORE SCROLL
AFTER SCROLL
In version 5 of Google Play Store app, scroll to the content, ActionBar on with scrolling, but the tabs are fixed to get on top.
How to do this?
BEFORE SCROLL
AFTER SCROLL
As others have suggested, use
ObservableScrollView
from: https://github.com/ksoichiro/Android-ObservableScrollViewTry putting both the
Toolbar
and theSlidingTabStrip
in the same container, then animate that container as the user scrolls theObservableScrollView
, for example:Then when you override the
ObservableScrollViewCallbacks
you could do something like this:The
onUpOrCancelMotionEvent
stuff is to animate the container to prevent the toolbar from being only half shown/hidden.Here's a demo video just for reference: https://drive.google.com/file/d/0B7TH7VeIpgSQSzZER1NneWpYa1E/view?usp=sharing
Great that you answer your question by yourself ;) Here is another small hint: Use a seperated layout for your tabs or integrate them into your toolbar and then tranlsate the toolbar only as far as you can see the tabs on top.
Take a look at these links (specially second link):
Android google-play-liked listview
ListView with a (half- and or) hidable header
Answer is here:
https://github.com/ksoichiro/Android-ObservableScrollView :D
This library is excellent for my case and very others