MotionLayout Swipe Bug

305 views Asked by At

I have created the fragment using motionlayout. my layout have 3 state: motion_left, motion_right and motion_center (main layout).

in the center i have some views. The problem is when i swipe from center to left or right. if my swipe range is on a touchable view. sometimes the transition work not exactly. i have debug and i know something like that: in the transition listener:

  • the onTransitionStart is called

  • onTransitionChange : the process do not implement from 0 to 1 (or 1 to 0). it did form 0 to value small than 1.

  • onTransitionCompleted : IS NOT CALLED.

it seem like crash screen but not. it keep the screen on process 0 < x < 1 . if i swipe one more time then it keep going transition from x to end point (0 or 1).

here is my transition code:

<Transition
    android:id="@+id/transition_right"
    motion:constraintSetEnd="@id/motion_right"
    motion:constraintSetStart="@id/motion_center"
    motion:duration="200"
    motion:motionInterpolator="linear">
    <OnSwipe
        motion:dragDirection="dragLeft"
        motion:touchRegionId="@id/layoutMain"
        motion:touchAnchorId="@id/anchor_right_view"
        motion:touchAnchorSide="left"
        motion:maxVelocity="10"
        motion:maxAcceleration="10" />
</Transition>

Is there the bug?? or I miss somewhere?

0

There are 0 answers