Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fixed header with CoordinatorLayout showing shadow when scrolling

The classic coordinator layout gives you the following [source]: coordinator layout

However, I don't want the top header views to scroll until they "become" a toolbar pinned at the top, with a shadow below. I want them all fixed (or pinned) but to show the shadow only the nested scroll view starts to scroll under the pinned ones. Something like the main app drawer on Marshmallow devices, where the "search bar" becomes pinned and the list of apps scroll under it.

Hope I made myself clear. Is there any easy way I could achieve that without listening for scroll events and handling this manually?

EDIT

Here is what I'm trying to achieve:

App drawer. Notice on the right image how there is now a shadow below the list of apps because the user scrolled the list.

Thank you!

like image 304
Testing Here Avatar asked Oct 31 '22 01:10

Testing Here


1 Answers

This is exactly what you are looking for: HideOnScroll

like image 84
RATHI Avatar answered Nov 15 '22 06:11

RATHI