Collapsing toolbars
Toolbars that slide out of the way conveniently are a common feature of material design UIs, and provide an elegant and clever way to make good use of the limited space available on phones and even laptops.
As you would imagine the CollapsingToolbarLayout is part of the design support library. It is intended as a child of the AppBarLayout, which is a linear layout, designed specifically for material design features.
Collapsing toolbars help manage space elegantly and also provide a good opportunity to display attractive graphics and help promote our product. They take little time to implement and are easily adapted.
The best way to see how they work is to build one, and the following steps demonstrate how to do this:
Start a new project and include the both the recycler view and the design support libraries.
Remove the action bar by changing the theme to:
Theme.AppCompat.Light.NoActionBar
Open the
activity_main.xml
file and apply the following root layout:<android...