
To help you get started, Android Studio 2.2's New Project wizard uses ConstraintLayout as the default layout for many of its project templates.

For example, you could connect the right side of a TextView to the right edge of its parent ConstraintLayout.

You can also create constraints between a view and its parent container. For example, connecting the top side of ImageView1 to the bottom of ImageView2 means that ImageView1 always appears below ImageView2. Constraints allow you to dictate how a view is positioned on the screen relative to other user interface elements. The secret sauce that could make ConstraintLayout your new favorite layout are constraints. However, ConstraintLayout is more flexible than RelativeLayout, plus it has the added benefit of being designed to work perfectly with Android Studio’s shiny new layout editor. If this all sounds a bit familiar, then that’s because ConstraintLayout is fundamentally similar to RelativeLayout. This means you can create complex user interfaces without having to resort to nesting multiple layouts, which is always bad news for your app’s performance. This new layout lets you define the layout of each view based on its relation to other elements in your layout. ConstraintLayoutĬonstraintLayout is a flexible layout manager that was designed especially for Android Studio's brand new layout editor.

In fact, it is so special that it deserves its own section. The final new feature that has an important role to play in Android Studio’s revamped layout editor is a bit special. You can edit all of these properties directly in the Properties panel. Select any view in your layout and the Properties panel will display the most important properties for this particular view, such as its width, contentDescription, and even the view’s contents if you select something like a TextView or ImageView. Since you have the Design tab selected, you should also notice another new addition to the layout editor, the Properties panel on the right. To see blueprint mode in action, make sure you have Android Studio’s Design tab selected and then click the Show Blueprint icon (where the cursor is positioned in the screenshot below). The first neat addition to Android Studio's layout editor is a blueprint mode that temporarily hides the finer details of your layout, so you're free to scrutinize the spacing and arrangement of your user interface without any distractions. In fact, when you first launch Android Studio 2.2 Preview, you might be surprised by just how different the editor looks. One of the most obvious features introduced in Android Studio 2.2 is the new layout editor.
