Based on the fact that Constraint Layout was created to avoid container nesting (one of the reasons), how then to avoid nesting in the case when you need to divide the layout into 2 colors?
Like this
Here is the XML
<?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <android.support.constraint.Guideline android:id="@+id/guideline7" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" app:layout_constraintGuide_percent="0.5" tools:layout_editor_absoluteX="192dp" tools:layout_editor_absoluteY="0dp"/> <android.support.constraint.ConstraintLayout android:layout_width="0dp" android:layout_height="0dp" android:background="#000000" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toLeftOf="@+id/guideline7" app:layout_constraintTop_toTopOf="parent"> </android.support.constraint.ConstraintLayout> <android.support.constraint.ConstraintLayout android:layout_width="0dp" android:layout_height="0dp" android:layout_marginBottom="0dp" android:layout_marginLeft="0dp" android:layout_marginRight="0dp" android:layout_marginTop="0dp" android:background="#FFFFFF" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintHorizontal_bias="0.0" app:layout_constraintLeft_toLeftOf="@+id/guideline7" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" app:layout_constraintVertical_bias="0.0"> </android.support.constraint.ConstraintLayout> </android.support.constraint.ConstraintLayout> But it still turns out that I need to do the nesting
Or not?


ConstrainLayoutimplies only the root container (ConstraintLayoutitself), without any nested containers, only widgets. In the question it is easy to notice 2 nested containers, alsoConstrainLayout- pavlofffConstrainLayoutwith justView. The result will be exactly the same. - eugeneek