I'm trying to figure out how to achieve the following behaviour using constraint layout:
- Place a view in the center of the ConstraintLayout parent
- Make the view width to be half of the parent's width
- Make the view height equals to its width
(i.e - place a square in the center)
I tried to use this combination:
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintDimensionRatio="2:1"
But I'm not sure how to continue from here