I'm just wondering when to choose CoordinatorLayout over the "Traditional" layouts or are they (or at least some of them) going to be deprecated?
So ConstraintLayout is useful, but (for now) it is not required for Android application development, any more than LinearLayout and RelativeLayout . And since ConstraintLayout is a library, you will need to take additional steps to add it to your project ( com.android.support.constraint:constraint-layout artifact com.android.support.constraint:constraint-layout in your closing dependencies of your build.gradle file modules), and this adds ~ 100 KB to the size of your Android application.
I personally am so used to writing layouts manually in xml, so the transition to ConstraintLayout is very difficult for me.
Drag and Drop GUI Constructor
Google is trying to simplify the life of developers and make them work faster and more productively, so they continue to improve the drag-drop GUI builder. However, the drag and drop gestures, the developer only providing you the X / Y coordinates of the widget, based on where the developer releases the mouse button and completes the drop. With LinearLayout adding a widget is very simple. Using the RelativeLayout for the GUI controller is difficult to handle drag and drop, and you probably have to dig inside the XML code to get it done. ConstraintLayout was created with GUI in mind, to make it a little easier to derive the correct rules based on where the developer removes the widget.
Recompilation of size and position
Changing widget details often causes dimensions to be recounted. For example, a change in the TextView may have the whole hierarchy go through the work of redistributing / re-positioning. If you have a container inside a container that is inside another container, etc., This means that parents are resizing / redefining their children, and this can be very expensive for deep hierarchies. So
Does ConstraintLayout have higher performance than nested Layout?
Yes, ConstraintLayout designed for performance, trying to eliminate as many passing scenarios as possible, and trying to eliminate the need for deeply nested view hierarchies.
Yes,
For more information, see CommonsWare’s Android Development Book . Where the use of ConstraintLayout is explained in more detail with comparison examples with other containers such as LinearLayout , RelativeLayout , etc. Indeed, the anatomy of android development.