title: set percent width constraintlayout Android programmatically
body: <p>For constraint layout v1.1.x in Android we can set height and width as percentage.
  Similarly, need to set view width and height as percent in Android programmatically:
  for example, this code is written in xml for some constraint layout:</p>
  
  <pre><code>&lt;!-- the widget will take 40% of the available space --&gt;
      app:layout_constraintWidth_default="percent"
      app:layout_constraintWidth_percent="0.4"
  </code></pre>
  
  <p>what will be its java code for doing it runtime?</p>