title: Z-index in ConstraintLayout
body: <p>I have a simple <code>ConstraintLayout</code>:</p>
  
  <pre><code>&lt;android.support.constraint.ConstraintLayout
      android:id="@+id/basketLayout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
          &lt;TextView
              android:id="@+id/basketItemnumber"
              android:layout_width="20dp"
              android:layout_height="20dp"
              android:background="@drawable/basket_item_number"
              android:text="1"
              android:textColor="@color/white"
              android:gravity="center"
              app:layout_constraintBottom_toBottomOf="@id/marginSpacer"
              app:layout_constraintEnd_toEndOf="@id/shoppingBasketButton"/&gt;
  
          &lt;android.support.v4.widget.Space
              android:id="@+id/marginSpacer"
              android:layout_width="0dp"
              android:layout_height="0dp"
              android:layout_marginTop="15dp"
              app:layout_constraintTop_toTopOf="@+id/shoppingBasketButton"
              app:layout_constraintLeft_toLeftOf="@id/shoppingBasketButton"
              app:layout_constraintRight_toRightOf="@id/shoppingBasketButton" /&gt;
  
          &lt;android.support.design.widget.FloatingActionButton
              android:id="@+id/shoppingBasketButton"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginBottom="15dp"
              android:layout_marginEnd="15dp"
              android:layout_marginRight="15dp"
              android:clickable="true"
              android:focusable="auto"
              android:focusableInTouchMode="false"
              app:backgroundTint="@color/colorPrimary"
              app:srcCompat="@drawable/ic_shopping_cart"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintBottom_toBottomOf="parent"/&gt;
  
  &lt;/android.support.constraint.ConstraintLayout&gt;
  </code></pre>
  
  <p>Now the <code>shoppingBasketButton</code> is overlapping the <code>basketItemnumber</code> but I want to have it the other way round.</p>
  
  <p>But I could not figure out how to change the z-index of the items.</p>
  
  <p>I tried <code>setTranslationZ</code> and <code>setZ</code> but wasn't successful.</p>
  
  <p><code>bringToFront()</code> also didn't work for me.</p>
  
  <p><strong>Edit:</strong>
  I managed to get it working with: </p>
  
  <pre><code>ViewCompat.setZ(basketItemnumber, 999);
  basketItemnumber.invalidate();
  </code></pre>
  
  <p>But I couldn't manage to do this for API &lt; 21. </p>
  
  <p><strong>Edit:</strong>
  I also tried already to change the order of my views. This did not work.</p>