From c1074125b56a9d7b5d56bde01b5bfb33a2cd4c20 Mon Sep 17 00:00:00 2001 From: Nick Chameyev Date: Thu, 21 Oct 2021 19:02:51 +0100 Subject: [PATCH] StatusBar unfold transition: reset translations when rotating When rotating the screen scoped status bar unfold transition provider stops the animation and invokes onTransitionFinished callback but the translations of the views are not cleared. It led to incorrect translations of the status bar icons after rotating the screen during the animation. Bug: 201518277 Test: rotate the phone during unfold animation Change-Id: I3bcd48f73e43133e3d53c7ba9f25e9618a037d4c --- .../phone/StatusBarMoveFromCenterAnimationController.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarMoveFromCenterAnimationController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarMoveFromCenterAnimationController.kt index 2707fa3c235ad..8ef186c316f91 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarMoveFromCenterAnimationController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarMoveFromCenterAnimationController.kt @@ -63,5 +63,11 @@ class StatusBarMoveFromCenterAnimationController @Inject constructor( override fun onTransitionProgress(progress: Float) { moveFromCenterAnimator?.onTransitionProgress(progress) } + + override fun onTransitionFinished() { + // Reset translations when transition is stopped/cancelled + // (e.g. the transition could be cancelled mid-way when rotating the screen) + moveFromCenterAnimator?.onTransitionProgress(1f) + } } }