android-ConstraintLayoutExamples
android-ConstraintLayoutExamples copied to clipboard
MotionLayout 2.0.0-beta2 scene_03 XML parser error must be within a Constraint 26
XML parser error must be within a Constraint 26 how to solve it ...
<Transition
motion:constraintSetStart="@+id/start"
motion:constraintSetEnd="@+id/end"
motion:motionInterpolator="linear"
motion:duration="1000">
<OnSwipe
motion:touchAnchorId="@+id/iv"
motion:touchAnchorSide="right"
motion:dragDirection="dragRight" />
</Transition>
<ConstraintSet android:id="@+id/start">
<Constraint
android:id="@+id/iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
motion:layout_constraintBottom_toBottomOf="parent"
motion:layout_constraintStart_toStartOf="parent"
motion:layout_constraintTop_toTopOf="parent" />
<CustomAttribute
motion:attributeName="BackgroundColor"
motion:customColorValue="#D81B60" />
</ConstraintSet>
<ConstraintSet android:id="@+id/end">
<Constraint
android:id="@+id/iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
motion:layout_constraintBottom_toBottomOf="parent"
motion:layout_constraintEnd_toEndOf="parent"
motion:layout_constraintTop_toTopOf="parent" />
<CustomAttribute
motion:attributeName="BackgroundColor"
motion:customColorValue="#9999FF" />
</ConstraintSet>
@zhangqifan1 I think you had wrong usage in your MotionScene, you should put CustomAttribute inside the Constraint because of losing targetView binding.
<Transition
motion:constraintSetStart="@+id/start"
motion:constraintSetEnd="@+id/end"
motion:duration="1000">
<OnSwipe
motion:touchAnchorId="@+id/iv"
motion:touchAnchorSide="right"
motion:dragDirection="dragRight" />
</Transition>
<ConstraintSet android:id="@+id/start">
<Constraint
android:id="@+id/iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
motion:layout_constraintBottom_toBottomOf="parent"
motion:layout_constraintStart_toStartOf="parent"
motion:layout_constraintTop_toTopOf="parent"
motion:attributeName="BackgroundColor"
motion:customColorValue="#D81B60" />
</ConstraintSet>
<ConstraintSet android:id="@+id/end">
<Constraint
android:id="@+id/iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
motion:layout_constraintBottom_toBottomOf="parent"
motion:layout_constraintEnd_toEndOf="parent"
motion:layout_constraintTop_toTopOf="parent"
motion:attributeName="BackgroundColor"
motion:customColorValue="#9999FF"
/>
</ConstraintSet>
No error,but it doesn't work..
I m so sorry. I didn't see it until today
motion:layout_constraintStart_toStartOf="parent"
motion:layout_constraintTop_toTopOf="parent" >
<CustomAttribute
motion:attributeName="BackgroundColor"
motion:customColorValue="#D81B60"
/>
</Constraint>
</ConstraintSet>