Open PetarMarijanovic opened 6 years ago
I have set app:layout_goneMarginEnd on my view and when I clone the ConstraintSet gone margins are not cloned. I've found my view by its id in the ConstraintSet and all gone margins are set to -1.
app:layout_goneMarginEnd
<TextView android:id="@+id/title" android:layout_width="0dp" android:layout_height="wrap_content" app:layout_constraintEnd_toStartOf="@+id/icon" app:layout_constraintStart_toEndOf="@+id/icon" app:layout_constraintTop_toTopOf="@+id/background" app:layout_goneMarginEnd="@dimen/gone_margin"/>
Constraint constraintSet = new ConstraintSet(); constraintSet.clone(this);
When I set it manually it works fine
constraintSet.setGoneMargin(title.getId(), ConstraintSet.END, goneMargin);
Update to constratlayoutandroidx.constraintlayout:constraintlayout:2.0.1 fix this issue
androidx.constraintlayout:constraintlayout:2.0.1
I have set
app:layout_goneMarginEnd
on my view and when I clone the ConstraintSet gone margins are not cloned. I've found my view by its id in the ConstraintSet and all gone margins are set to -1.When I set it manually it works fine