August 2017
Beginner to intermediate
220 pages
4h 50m
English
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:
compile 'com.android.support:percent:25.1.1'
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" ...
Read now
Unlock full access