I have a layout like the following:
(Toolbar, Header View, Text View, RecyclerView)
I need the header to be collapsed when I scrolling recyclerview\
You can achieve it by having this layout:
.....
You pin your toolbar by having the app:layout_collapseMode="pin" property set. You make RecyclerView properly scrollable by setting app:layout_behavior="@string/appbar_scrolling_view_behavior" and that's pretty much it.
NB! Position of "Choose item" TextView depends on the particular behaviour you want to achieve:
RecyclerView's Adapter to scroll it away, once user start scrolling through the RecyclerView;AppBarLayout so it will always stick on top of the RecyclerView, whenever you scroll it or not;You can read more here Android Design Support Library and here Design Support Library (III): Coordinator Layout
I hope, it helps!