Actually trigger back action on Back Arrow fling

Currently, when the New Back Arrow is flung and the finger lifted, we do
not actually send the trigger event -- but we do if the finger is lifted
after coming to a "stop", i.e., a commit without a "fling".

To test, swipe from the right edge inwards, and release while your finger is in motion (as opposed to "stop moving, and then lift").

Bug: 240272871
Test: Manual
Change-Id: I81d6e6b1bb42c2cd12d14ae861ba8eb9f3081d11
This commit is contained in:
Rahul Banerjee
2022-08-01 11:07:36 -07:00
parent 1f2a3d9f37
commit 15ebdf1e7c

View File

@@ -510,7 +510,6 @@ class BackPanelController private constructor(
private fun playCommitBackAnimation() {
// Check if we should vibrate again
if (previousState != GestureState.FLUNG) {
backCallback.triggerBack()
velocityTracker!!.computeCurrentVelocity(1000)
val isSlow = abs(velocityTracker!!.xVelocity) < 500
val hasNotVibratedRecently =
@@ -519,6 +518,10 @@ class BackPanelController private constructor(
vibratorHelper.vibrate(VibrationEffect.EFFECT_CLICK)
}
}
// Dispatch the actual back trigger
if (DEBUG) Log.d(TAG, "playCommitBackAnimation() invoked triggerBack() on backCallback")
backCallback.triggerBack()
playAnimation(setGoneEndListener)
}