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

Commit 4ce22b51 authored by Joshua Tsuji's avatar Joshua Tsuji
Browse files

Cancel flings before restarting them.

Test: atest SystemUITests
Change-Id: I68ed3beef526d93104bd9da809aa5f49d15a1e91
parent aaace7f2
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -416,8 +416,10 @@ class PhysicsAnimator<T> private constructor (val target: T) {
                        max = max(currentValue, this.max)
                    }

                    // Apply the configuration and start the animation.
                    // Apply the configuration and start the animation. Since flings can't be
                    // redirected while in motion, cancel it first.
                    getFlingAnimation(animatedProperty)
                            .also { it.cancel() }
                            .also { flingConfig.applyToAnimation(it) }
                            .start()
                }