Fix "appearance glitch" in Back Arrow

This avoids playing the Cancellation animation when we receive an
ACTION_CANCEL (and just goes straight to GONE), which fixes the glitch.

Bug: 237442123
Test: manual
Change-Id: Iab0fb98f5a71e1fe80d3949b4fbb35055c731b3f
This commit is contained in:
Rahul Banerjee
2022-07-07 10:19:58 -07:00
parent dbe797351d
commit 8a9db5f82a

View File

@@ -321,7 +321,10 @@ class BackPanelController private constructor(
velocityTracker = null
}
MotionEvent.ACTION_CANCEL -> {
updateArrowState(GestureState.CANCELLED)
// Receiving a CANCEL implies that something else intercepted
// the gesture, i.e., the user did not cancel their gesture.
// Therefore, disappear immediately, with minimum fanfare.
updateArrowState(GestureState.GONE)
velocityTracker = null
}
}