Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do we need AppBarLayout when we are using CollapsingToolbarLayout?

CollapsingToolbarlayout in Appbarlayout

Also, what's the difference between an appbar layout and a collapsing toolbar layout?

Thanks a lot :)

like image 468
thelearner Avatar asked Mar 19 '17 15:03

thelearner


1 Answers

AppBarLayout is a vertical LinearLayout which implements many of the features of material designs app bar concept, namely scrolling gestures.

Children should provide their desired scrolling behavior through setScrollFlags(int) and the associated layout xml attribute: app:layout_scrollFlags.

This view depends heavily on being used as a direct child within a CoordinatorLayout. If you use AppBarLayout within a different ViewGroup, most of it's functionality will not work.

CollapsingToolbarLayout is a wrapper for Toolbar which implements a collapsing app bar. It is designed to be used as a direct child of a AppBarLayout.

like image 194
dzikovskyy Avatar answered Nov 15 '22 17:11

dzikovskyy