Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4e512f9f authored by Michael Mikhail's avatar Michael Mikhail
Browse files

Fixing animation behavior on UMO snapback

If user tries to swipe While the snapback animation is going back, we
need to cancel the ongoing animation.

Bug: 247810047
Test: Checked the snapback animation and the translation of the
UMO while swiping and releasing the UMO to go back.

Change-Id: I0d6a70a04aeda29338c28ba37b11450aedc06dec
parent 3c300767
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -289,7 +289,10 @@ class MediaCarouselScrollHandler(
                return false
                return false
            }
            }
        }
        }
        if (isUp || motionEvent.action == MotionEvent.ACTION_CANCEL) {
        if (motionEvent.action == MotionEvent.ACTION_MOVE) {
            // cancel on going animation if there is any.
            PhysicsAnimator.getInstance(this).cancel()
        } else if (isUp || motionEvent.action == MotionEvent.ACTION_CANCEL) {
            // It's an up and the fling didn't take it above
            // It's an up and the fling didn't take it above
            val relativePos = scrollView.relativeScrollX % playerWidthPlusPadding
            val relativePos = scrollView.relativeScrollX % playerWidthPlusPadding
            val scrollXAmount: Int
            val scrollXAmount: Int