我无法在customColorValue
的{{1}}中添加第三个customIntegerValue
,customFloatvalue
或MotionLayout
。 MotionScene
不断抛出MotionController
。这是一个可以轻松重现此内容的简单布局:
ArrayIndexOutOfBoundsException
<androidx.constraintlayout.motion.widget.MotionLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layoutDescription="@xml/motion_scene">
<com.spruce.messenger.composer.MessageTypeButton
android:id="@+id/messageType"
style="@style/messageTypeSelectionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Message" />
</androidx.constraintlayout.motion.widget.MotionLayout>
文件:
motion_scene
添加第三个<?xml version="1.0" encoding="utf-8"?>
<MotionScene xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:motion="http://schemas.android.com/apk/res-auto">
<Transition
motion:constraintSetEnd="@+id/end"
motion:constraintSetStart="@+id/start"
motion:duration="100"
motion:motionInterpolator="linear">
<OnSwipe
motion:dragDirection="dragRight"
motion:maxacceleration="18"
motion:onTouchUp="autoComplete"
motion:touchAnchorId="@+id/messageType"
motion:touchAnchorSide="left"
motion:touchRegionId="@+id/messageType" />
</Transition>
<ConstraintSet android:id="@+id/start">
<Constraint android:id="@+id/messageType">
<CustomAttribute
motion:attributeName="StrokeTintColor"
motion:customColorValue="#D68739" />
<CustomAttribute
motion:attributeName="TextColor"
motion:customColorValue="#2D70FF" />
<CustomAttribute
motion:attributeName="BackgroundTint"
motion:customColorValue="#F1F6FF" />
</Constraint>
</ConstraintSet>
<ConstraintSet android:id="@+id/end">
<Constraint android:id="@id/messageType">
<CustomAttribute
motion:attributeName="StrokeTintColor"
motion:customColorValue="#D68739" />
<CustomAttribute
motion:attributeName="TextColor"
motion:customColorValue="#D68739" />
<CustomAttribute
motion:attributeName="BackgroundTint"
motion:customColorValue="#FFFCF3" />
</Constraint>
</ConstraintSet>
</MotionScene>
,customColorValue
或customIntegerValue
后,我会不断遵循以下异常:
customFloatvalue
还提出了一个错误,以防万一https://issuetracker.google.com/issues/144151823