I have a Barrier which references three views. These three views are beneath one another, like this:
---- View A
---- View B
---- Group
--------- Barrier
---- View D
View D has a constraint to the Barrier and View B and the Group at any time may become become View.GONE
.
Furthermore, the Group is initially empty. I programmatically inflate views under View B and I associate all of them to the Group.
The Problem though is that when I inflate views in to the Group, View D does not move and stays underneath View B.
Code which shows the Group, the Barrier and View D:
<androidx.constraintlayout.widget.Group
android:id="@+id/group"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/view_b" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/header_barrier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="group, view_a, view_b" />
<View
android:id="@+id/bottom_shadow"
android:layout_width="0dp"
android:layout_height="@dimen/grid_8"
android:background="@drawable/orders_shadow_white"
app:layout_constraintBottom_toBottomOf="@id/barrier"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />