title: Applying margins programmatically in a Constraint Layout
body: <p>I cannot get margins to work correctly when using a <code>ConstraintSet</code></p>
  
  <pre><code>    ConstraintSet constraintSet = new ConstraintSet();
      ConstraintLayout constraintLayout = (ConstraintLayout) LayoutInflater.from(this).inflate(R.layout.activity_main, null);
      constraintSet.clone(constraintLayout);
  
      // START WORKS
      //constraintSet.connect(R.id.text, ConstraintSet.START, ConstraintSet.PARENT_ID, ConstraintSet.START, 50);
      // LEFT DOES NOT
      constraintSet.connect(R.id.text, ConstraintSet.LEFT, ConstraintSet.PARENT_ID, ConstraintSet.LEFT, 50);
      constraintSet.connect(R.id.text, ConstraintSet.END, ConstraintSet.PARENT_ID, ConstraintSet.END, 50);
      constraintSet.connect(R.id.text, ConstraintSet.TOP, ConstraintSet.PARENT_ID, ConstraintSet.TOP, 50);
      constraintSet.connect(R.id.text, ConstraintSet.BOTTOM, ConstraintSet.PARENT_ID, ConstraintSet.BOTTOM, 50);
  
      constraintSet.applyTo(constraintLayout);
  </code></pre>
  
  <p>There's a small sample app there if anyone wants to reproduce: <a href="https://github.com/martinbonnin/TestConstraintLayout/tree/master" rel="nofollow noreferrer">https://github.com/martinbonnin/TestConstraintLayout/tree/master</a></p>
  
  <p>Anyone knows what I'm missing ? </p>