So I have a constraintLayout like this
<ConstraintLayout>
<TextView
android:id="@+id/text_view"
app:layout_constraintEnd_toStartOf="@+id/view1" />
<View
android:id="@+id/view1"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<View
android:id="@+id/view2"
aapp:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</ConstraintLayout>
Currently the textview's end is at the start of view1, however, when view1's visibility is gone, I want the end of textview to the start of view2, otherwise the long string may cover view2. Is there any way to set the constraint to two views or is there any better solution for this?