CoordinatorLayout and Behaviors
suggest changeVersions
CoordinatorLayout is in the Design Support Library (com.android.support:design). It is not a framework class that shipped with Android 3.0.
Introduction
CoordinatorLayout is a super-powered FrameLayout. Its job is to coordinate the views inside it.
Most of that coordination is declared in XML, including animations and transitions between children.
CoordinatorLayout has two primary uses:
- As a top-level application decor or chrome layout
- As a container for a specific interaction with one or more child views
Remarks
The CoordinatorLayout is a container that extends the FrameLayout.
A CoordinatorLayout.Behavior on a direct child can intercept touch events, window insets, measurement, layout, and nested scrolling.
By specifying Behaviors for child views of a CoordinatorLayout you can provide many different interactions within a single parent and those views can also interact with one another. View classes can specify a default behavior when used as a child of a CoordinatorLayout using the DefaultBehavior annotation.