title: Android Constraint Layout Barrier and Gone Margin
body: <p>I have a constraint layout looks like this:</p>
  <pre><code>A-B
  --------- (barrier that refer to A and B bottom)
  C (constraint_top_bottomOf barrier)
  </code></pre>
  <p>Here is the code:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      tools:context=&quot;.TypographyActivity&quot;
      android:background=&quot;?attr/lightPrimary&quot;&gt;
  
      &lt;TextView
          android:id=&quot;@+id/textviewA&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_marginTop=&quot;10dp&quot;
          app:layout_constraintStart_toStartOf=&quot;parent&quot;
          app:layout_constraintEnd_toStartOf=&quot;@+id/textviewB&quot;
          app:layout_constraintTop_toTopOf=&quot;parent&quot;
          android:text=&quot;Text A&quot; /&gt;
  
      &lt;TextView
          android:id=&quot;@+id/textviewB&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_marginTop=&quot;10dp&quot;
          app:layout_constraintStart_toEndOf=&quot;@id/textviewA&quot;
          app:layout_constraintTop_toTopOf=&quot;parent&quot;
          android:text=&quot;Text B&quot; /&gt;
  
      &lt;androidx.constraintlayout.widget.Barrier
          android:id=&quot;@+id/barrier&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          app:barrierDirection=&quot;bottom&quot;
          app:constraint_referenced_ids=&quot;textviewA, textviewB&quot; /&gt;
  
      &lt;TextView
          android:id=&quot;@+id/textviewC&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_marginTop=&quot;10dp&quot;
          app:layout_goneMarginTop=&quot;30dp&quot;
          app:layout_constraintStart_toStartOf=&quot;parent&quot;
          app:layout_constraintTop_toBottomOf=&quot;@id/barrier&quot;
          android:text=&quot;Text C&quot; /&gt;
  
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  </code></pre>
  <p>goneMarginTop in textviewC always triggered even when A and B are visible.</p>
  <p>Is there a way I can add goneMarginTop to textviewC, when A and B are gone without wrapping A and B to another layout?</p>
  <p>Thank you.</p>