Search code examples
androidandroid-motionlayout

MotionLayout onSwipe autocomplete speed


Is there any way I can speed up the animation that plays when I stop mid-swipe in a MotionLayout with an onSwipe transition? Currently it transitions very slowly to the start or end position.


Solution

  • I was wondering if there's such thing as autoComplete duration too. After some research I've found out that using app:maxAcceleration parameter on onSwipe helps to gain the control over this duration.

    e.g.

    <OnSwipe
            app:maxAcceleration="40"
            app:dragDirection="dragUp"
            app:touchAnchorId="@+id/view_one"
            app:touchAnchorSide="top"
            app:touchRegionId="@id/view_one"/>