Coordinating the Overview Screen
The Overview screen you built in Chapter 7, Creating Overview Screens, is a perfect candidate for a CoordinatorLayout
. To start with, the allowance overview bar can be made to collapse, and unfold as the user scrolls. This allows more space for the claim items on the screen as they are scrolling, and by expanding the overview again when they scroll upward, the user doesn't have to scroll all the way to the top to get the overview back.
This behavior won't just use the CoordinatorLayout
, but will also need the help of the AppBarLayout
and CollapsingToolbarLayout
classes as you'll need to take control of the Material Design scaffolding to make it work. Follow these steps to move the allowance overview into the header bar and make it collapse:
- First, open the
AndroidManifest
file from themanifests
folder in the project tree (use theAndroid
perspective). - Find the
OverviewActivity
entry and add a theme attribute that will tell the system not to provide a system...