diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/animation/BubbleBarViewAnimator.kt b/quickstep/src/com/android/launcher3/taskbar/bubbles/animation/BubbleBarViewAnimator.kt index f5a6655070..6f8943f303 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/animation/BubbleBarViewAnimator.kt +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/animation/BubbleBarViewAnimator.kt @@ -511,23 +511,21 @@ constructor( /** Interrupts the animation due to touching the bubble bar or flyout. */ fun interruptForTouch() { + animatingBubble?.hideAnimation?.let { scheduler.cancel(it) } PhysicsAnimator.getInstance(bubbleBarView).cancelIfRunning() bubbleStashController.getStashedHandlePhysicsAnimator().cancelIfRunning() cancelFlyout() - val hideAnimation = animatingBubble?.hideAnimation ?: return - scheduler.cancel(hideAnimation) - bubbleBarView.relativePivotY = 1f + resetBubbleBarPropertiesOnInterrupt() clearAnimatingBubble() } /** Notifies the animator that the taskbar area was touched during an animation. */ fun onStashStateChangingWhileAnimating() { + animatingBubble?.hideAnimation?.let { scheduler.cancel(it) } cancelFlyout() - val hideAnimation = animatingBubble?.hideAnimation ?: return - scheduler.cancel(hideAnimation) clearAnimatingBubble() bubbleStashController.getStashedHandlePhysicsAnimator().cancelIfRunning() - bubbleBarView.relativePivotY = 1f + resetBubbleBarPropertiesOnInterrupt() bubbleStashController.onNewBubbleAnimationInterrupted( /* isStashed= */ bubbleBarView.alpha == 0f, bubbleBarView.translationY, @@ -541,7 +539,7 @@ constructor( scheduler.cancel(hideAnimation) animatingBubble = null bubbleStashController.getStashedHandlePhysicsAnimator().cancelIfRunning() - bubbleBarView.relativePivotY = 1f + resetBubbleBarPropertiesOnInterrupt() // stash the bubble bar since the IME is now visible bubbleStashController.onNewBubbleAnimationInterrupted( /* isStashed= */ true, @@ -679,6 +677,12 @@ constructor( bubbleStashController.showBubbleBarImmediate() } + private fun resetBubbleBarPropertiesOnInterrupt() { + bubbleBarView.relativePivotY = 1f + bubbleBarView.scaleX = 1f + bubbleBarView.scaleY = 1f + } + private fun PhysicsAnimator?.cancelIfRunning() { if (this?.isRunning() == true) cancel() } diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/animation/BubbleBarViewAnimatorTest.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/animation/BubbleBarViewAnimatorTest.kt index 29d142f3ec..06227e23d0 100644 --- a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/animation/BubbleBarViewAnimatorTest.kt +++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/bubbles/animation/BubbleBarViewAnimatorTest.kt @@ -197,6 +197,8 @@ class BubbleBarViewAnimatorTest { assertThat(bubbleBarParentViewController.timesInvoked).isEqualTo(2) assertThat(animatorScheduler.delayedBlock).isNull() assertThat(bubbleBarView.alpha).isEqualTo(1) + assertThat(bubbleBarView.scaleX).isEqualTo(1) + assertThat(bubbleBarView.scaleY).isEqualTo(1) assertThat(bubbleBarView.visibility).isEqualTo(VISIBLE) assertThat(bubbleBarView.translationY).isEqualTo(BAR_TRANSLATION_Y_FOR_TASKBAR) assertThat(animator.isAnimating).isFalse() @@ -241,6 +243,8 @@ class BubbleBarViewAnimatorTest { // verify that the hide animation was canceled assertThat(animatorScheduler.delayedBlock).isNull() assertThat(animator.isAnimating).isFalse() + assertThat(bubbleBarView.scaleX).isEqualTo(1) + assertThat(bubbleBarView.scaleY).isEqualTo(1) verify(bubbleStashController).onNewBubbleAnimationInterrupted(any(), any()) // PhysicsAnimatorTestUtils posts the cancellation to the main thread so we need to wait