ConstraintLayout - proportional width/height to self? : <p>I'm trying to figure out how to achieve the following behaviour using constraint layout:</p>

<ol>
<li>Place a view in the center of the ConstraintLayout parent</li>
<li>Make the view width to be half of the parent's width</li>
<li>Make the view height equals to its width</li>
</ol>

<p>(i.e - place a square in the center)</p>

<p>I tried to use this combination:</p>

<pre><code>  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"
</code></pre>

<p>But I'm not sure how to continue from here</p>
