Currently AppBarLayout lacks the functionality which
CollapsingToolbarLayout does, to draw a drawable behind
the status bar. This CL adds that functionality.
Also added related functionality to Catalog
PiperOrigin-RevId: 242949840
When AppBarLayout is used with a CollapsingToolbarLayout
child, it currently does not handle WindowInsets
very well. This commit fixes that by properly handling
insets.
The primary issue is when an AppBarLayout is used
with a single Toolbar (very common use case), where
the Toolbar will currently be displayed behind the status bar.
Another issue is with HeaderScrollingViewBehavior.
To workaround CoordinatorLayout using its 'compatible measuring'
for insets, the behavior manually sets the scrolling view to fit
system windows. This has other issues though because
that view will get padded in. Fixed by manually adding the insets
back into the measured dimensions.
Also updated the catalog layouts to make use of
android:fitsSystemWindows=true
Resolves https://github.com/material-components/material-components-android/pull/299
PiperOrigin-RevId: 238396626
- Add liftOnScrollTargetViewId attribute to allow client to specify the scrolling view that should be listened to for updating AppBarLayout lifted state.
- Use View#canScrollVertically instead of View#getScrollY to determine lifted state.
PiperOrigin-RevId: 213614055