Reset the bubble bar scale when the animation is interrupted

Flag: com.android.wm.shell.enable_bubble_bar
Fixes: 381283214
Test: atest BubbleBarViewAnimatorTest
Test: manual
       - have a bubble in the bubble bar
       - launch an app
       - set animator scale to 5x to slow down animation
       - send a bubble
       - when the bubble bar animates interrupt the animation by
         touching the bubble bar
       - observe the bubble bar scale is reset correctly
Change-Id: I1abd81e3df987ba749a13eb1b7506d5c1d8fdddd
This commit is contained in:
Liran Binyamin
2024-11-27 15:14:01 -05:00
parent 495fe1d255
commit 3931b671b4
2 changed files with 15 additions and 7 deletions

View File

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