title: Creating a square based on screen width android using constraint layout
body: <p>I am trying to create a view that equals fifty percent of screen width and height should be same as width in a constraint layout</p>
  
  <pre><code>&lt;android.support.v7.widget.CardView
          app:layout_constraintWidth_default="percent"
          app:layout_constraintWidth_percent="0.5"
          android:layout_width="0dp"
          android:layout_height="0dp"
          app:layout_constraintDimensionRatio="1:1"
          android:id="@+id/cardLayout"
          app:cardElevation="3dp"
          app:cardCornerRadius="50dp"
          app:cardBackgroundColor="@android:color/transparent"
          &gt;
  </code></pre>
  
  <p>However this doesn't seem to be working. I have also tried changing width to <code>wrap_content</code>. What needs to be fixed here?</p>