O'Reilly logo

Mastering Android Studio 3 by Kyle Mew

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The coordinator layout

The design library provides three layout classes. There is one for designing tabular activities and one for toolbars, but the most important layout is CoordinatorLayout, which acts as a material-aware container, automatically performing many material tricks, such as expanding headers when a user scrolls to the top of a list or ensuring a FABs slides out of the way when a snack bar pops up over it.

The coordinator layout should be placed as the root layout of an activity and would typically look like the following lines:

<android.support.design.widget.CoordinatorLayout      xmlns:android="http://schemas.android.com/apk/res/android"     android:id="@+id/coordinator_layout"     android:layout_width="match_parent"  android:layout_height="match_parent" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required