The percent support library offers just two layout classes PercentRelativeLayout and PercentFrameLayout. It needs to be added to the gradle build file as a dependency, as follows:
To recreate the layout in the previous section, we need to place AppBarLayout inside PercentRelativeLayout. We can then use a percentage value to set the maximum height of our app bar, as follows:
<android.support.percent.PercentRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.AppBarLayout android:id="@+id/app_bar" ...