From 8a9db5f82a6d880fd673b3930a870f8568395f64 Mon Sep 17 00:00:00 2001 From: Rahul Banerjee Date: Thu, 7 Jul 2022 10:19:58 -0700 Subject: [PATCH] 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 --- .../systemui/navigationbar/gestural/BackPanelController.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/gestural/BackPanelController.kt b/packages/SystemUI/src/com/android/systemui/navigationbar/gestural/BackPanelController.kt index 8179d1763ea1f..a833670597361 100644 --- a/packages/SystemUI/src/com/android/systemui/navigationbar/gestural/BackPanelController.kt +++ b/packages/SystemUI/src/com/android/systemui/navigationbar/gestural/BackPanelController.kt @@ -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 } }