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
This commit is contained in:
Nick Chameyev
2021-10-21 19:02:51 +01:00
parent ca3316df61
commit c1074125b5

View File

@@ -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)
}
}
}