添加三个或更多CustomAttribute元素时,MotionLayout抛出ArrayIndexOutOfBoundsException

我无法在customColorValue的{​​{1}}中添加第三个customIntegerValuecustomFloatvalueMotionLayoutMotionScene不断抛出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> customColorValuecustomIntegerValue后,我会不断遵循以下异常:

customFloatvalue

还提出了一个错误,以防万一https://issuetracker.google.com/issues/144151823

jimeidaxuecy 回答:添加三个或更多CustomAttribute元素时,MotionLayout抛出ArrayIndexOutOfBoundsException

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3134146.html

大家都在问