title: Android - ConstraintLayout percentage using dimens
body: <p>There is a question <a href="https://stackoverflow.com/questions/37318228/how-to-make-constraintlayout-work-with-percentage-values">How to make ConstraintLayout work with percentage values?</a> and its answers show how to use the percentages:</p>
  
  <pre><code>&lt;android.support.constraint.Guideline
      android:id="@+id/guideline"
      android:layout_width="1dp"
      android:layout_height="wrap_content"
      android:orientation="vertical"
      app:layout_constraintGuide_percent="0.5"/&gt;
  </code></pre>
  
  <p>But if you don't want to hardcode the percentage but use a dimen resource it does not work. </p>
  
  <pre><code>&lt;!-- inside the layout --&gt;
  
  &lt;android.support.constraint.Guideline
      android:id="@+id/guideline"
      android:layout_width="1dp"
      android:layout_height="wrap_content"
      android:orientation="vertical"
      app:layout_constraintGuide_percent="@dimen/guideline_perc"/&gt;
  
  &lt;!-- inside dimens.xml --&gt;
  
  &lt;dimen name="guideline_perc&gt;0.5&lt;/dimen&gt;
  </code></pre>
  
  <p>You get the following error:</p>
  
  <p><code>Float types not allowed (at 'guideline_perc' with value 0.5).</code></p>
  
  <p>If you replace the value with 1, a similar error is returned:</p>
  
  <p><code>Integer types not allowed (at 'guideline_perc' with value 1).</code></p>
  
  <p>How do you set a percentage without hardcoding the value into the layout?</p>