I've a button inside a MotionLayout:
<com.google.android.material.button.MaterialButton
android:id="@+id/button"
style="@style/MyButtonStyle"
android:layout_marginBottom="@{DEBUG ? 40dp : 16dp}"
android:paddingStart="34dp"
android:paddingEnd="34dp"
android:text="Next"
android:textAlignment="center"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
tools:enabled="false" />
and a ConstraintSet for this button:
<Constraint
android:id="@+id/button"
style="@style/MyButtonStyle"
android:layout_marginBottom="@{DEBUG ? 40dp : 16dp}"
android:paddingStart="34dp"
android:paddingEnd="34dp"
android:text="Next"
android:textAlignment="center"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
tools:enabled="false"
app:debugMarginBottom="@{@dimen/gap_40_dp}"
app:marginBottom="@{@dimen/gap_16_dp}"
>
while app:debugMarginBottom
and app:marginBottom
are bindingAdapter values I created.
The problem is that the compilation fails cause app:debugMarginBottom is unknown (but if i put it in the layout itself, everything works).
How can I use data binding with MotionLayout?
Thanks.