diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java index 32ca9f2f7c..f16829b29f 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java @@ -124,8 +124,6 @@ public class BubbleBarView extends FrameLayout { private final BubbleBarBackground mBubbleBarBackground; - private boolean mIsAnimatingNewBubble = false; - /** * The current bounds of all the bubble bar. Note that these bounds may not account for * translation. The bounds should be retrieved using {@link #getBubbleBarBounds()} which @@ -701,16 +699,6 @@ public class BubbleBarView extends FrameLayout { return mRelativePivotY; } - /** Notifies the bubble bar that a new bubble animation is starting. */ - public void onAnimatingBubbleStarted() { - mIsAnimatingNewBubble = true; - } - - /** Notifies the bubble bar that a new bubble animation is complete. */ - public void onAnimatingBubbleCompleted() { - mIsAnimatingNewBubble = false; - } - /** Add a new bubble to the bubble bar. */ public void addBubble(BubbleView bubble) { FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams((int) mIconSize, (int) mIconSize, @@ -1306,9 +1294,7 @@ public class BubbleBarView extends FrameLayout { @Override public boolean onInterceptTouchEvent(MotionEvent ev) { - if (mIsAnimatingNewBubble) { - mController.onBubbleBarTouchedWhileAnimating(); - } + mController.onBubbleBarTouched(); if (!mIsBarExpanded) { // When the bar is collapsed, all taps on it should expand it. return true; @@ -1316,11 +1302,6 @@ public class BubbleBarView extends FrameLayout { return super.onInterceptTouchEvent(ev); } - /** Whether a new bubble is currently animating. */ - public boolean isAnimatingNewBubble() { - return mIsAnimatingNewBubble; - } - private boolean hasOverflow() { // Overflow is always the last bubble View lastChild = getChildAt(getChildCount() - 1); @@ -1435,7 +1416,6 @@ public class BubbleBarView extends FrameLayout { pw.println(" bubble key: " + key); } pw.println(" isExpanded: " + isExpanded()); - pw.println(" mIsAnimatingNewBubble: " + mIsAnimatingNewBubble); if (mBubbleAnimator != null) { pw.println(" mBubbleAnimator.isRunning(): " + mBubbleAnimator.isRunning()); pw.println(" mBubbleAnimator is null"); @@ -1460,8 +1440,8 @@ public class BubbleBarView extends FrameLayout { /** Returns the translation Y that the bubble bar should have. */ float getBubbleBarTranslationY(); - /** Notifies the controller that the bubble bar was touched while it was animating. */ - void onBubbleBarTouchedWhileAnimating(); + /** Notifies the controller that the bubble bar was touched. */ + void onBubbleBarTouched(); /** Requests the controller to expand bubble bar */ void expandBubbleBar(); diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java index 83123b507b..eb6ff98bab 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java @@ -140,8 +140,8 @@ public class BubbleBarViewController { } @Override - public void onBubbleBarTouchedWhileAnimating() { - BubbleBarViewController.this.onBubbleBarTouchedWhileAnimating(); + public void onBubbleBarTouched() { + BubbleBarViewController.this.onBubbleBarTouched(); } @Override @@ -202,9 +202,12 @@ public class BubbleBarViewController { } } - private void onBubbleBarTouchedWhileAnimating() { - mBubbleBarViewAnimator.onBubbleBarTouchedWhileAnimating(); - mBubbleStashController.onNewBubbleAnimationInterrupted(false, mBarView.getTranslationY()); + private void onBubbleBarTouched() { + if (isAnimatingNewBubble()) { + mBubbleBarViewAnimator.onBubbleBarTouchedWhileAnimating(); + mBubbleStashController.onNewBubbleAnimationInterrupted(false, + mBarView.getTranslationY()); + } } private void expandBubbleBar() { @@ -303,8 +306,11 @@ public class BubbleBarViewController { /** Whether a new bubble is animating. */ public boolean isAnimatingNewBubble() { - return mBarView.isAnimatingNewBubble() - || (mBubbleBarViewAnimator != null && mBubbleBarViewAnimator.hasAnimatingBubble()); + return mBubbleBarViewAnimator != null && mBubbleBarViewAnimator.isAnimating(); + } + + public boolean isNewBubbleAnimationRunningOrPending() { + return mBubbleBarViewAnimator != null && mBubbleBarViewAnimator.hasAnimation(); } /** The horizontal margin of the bubble bar from the edge of the screen. */ @@ -627,7 +633,7 @@ public class BubbleBarViewController { * from SystemUI. */ public void setExpandedFromSysui(boolean isExpanded) { - if (isAnimatingNewBubble() && isExpanded) { + if (isNewBubbleAnimationRunningOrPending() && isExpanded) { mBubbleBarViewAnimator.expandedWhileAnimating(); return; } 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 b745193e2b..2ed88d83f1 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/animation/BubbleBarViewAnimator.kt +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/animation/BubbleBarViewAnimator.kt @@ -43,7 +43,13 @@ constructor( private val bubbleBarBounceDistanceInPx = bubbleBarView.resources.getDimensionPixelSize(R.dimen.bubblebar_bounce_distance) - fun hasAnimatingBubble() = animatingBubble != null + fun hasAnimation() = animatingBubble != null + + val isAnimating: Boolean + get() { + val animatingBubble = animatingBubble ?: return false + return animatingBubble.state != AnimatingBubble.State.CREATED + } private companion object { /** The time to show the flyout. */ @@ -157,7 +163,6 @@ constructor( private fun buildHandleToBubbleBarAnimation() = Runnable { moveToState(AnimatingBubble.State.ANIMATING_IN) // prepare the bubble bar for the animation - bubbleBarView.onAnimatingBubbleStarted() bubbleBarView.visibility = VISIBLE bubbleBarView.alpha = 0f bubbleBarView.translationY = 0f @@ -304,7 +309,6 @@ constructor( animator.addEndListener { _, _, _, canceled, _, _, _ -> animatingBubble = null if (!canceled) bubbleStashController.stashBubbleBarImmediate() - bubbleBarView.onAnimatingBubbleCompleted() bubbleBarView.relativePivotY = 1f bubbleStashController.updateTaskbarTouchRegion() } @@ -330,7 +334,6 @@ constructor( Runnable { animatingBubble = null bubbleStashController.showBubbleBarImmediate() - bubbleBarView.onAnimatingBubbleCompleted() bubbleStashController.updateTaskbarTouchRegion() } } @@ -343,7 +346,6 @@ constructor( private fun buildBubbleBarSpringInAnimation() = Runnable { moveToState(AnimatingBubble.State.ANIMATING_IN) // prepare the bubble bar for the animation - bubbleBarView.onAnimatingBubbleStarted() bubbleBarView.translationY = bubbleBarView.height.toFloat() bubbleBarView.visibility = VISIBLE bubbleBarView.alpha = 1f @@ -382,7 +384,6 @@ constructor( val hideAnimation = Runnable { animatingBubble = null bubbleStashController.showBubbleBarImmediate() - bubbleBarView.onAnimatingBubbleCompleted() bubbleStashController.updateTaskbarTouchRegion() } animatingBubble = @@ -398,7 +399,6 @@ constructor( */ private fun buildBubbleBarBounceAnimation() = Runnable { moveToState(AnimatingBubble.State.ANIMATING_IN) - bubbleBarView.onAnimatingBubbleStarted() val ty = bubbleStashController.bubbleBarTranslationY val springBackAnimation = PhysicsAnimator.getInstance(bubbleBarView) @@ -429,7 +429,6 @@ constructor( bubbleStashController.getStashedHandlePhysicsAnimator().cancelIfRunning() val hideAnimation = animatingBubble?.hideAnimation ?: return scheduler.cancel(hideAnimation) - bubbleBarView.onAnimatingBubbleCompleted() bubbleBarView.relativePivotY = 1f animatingBubble = null } @@ -440,7 +439,6 @@ constructor( scheduler.cancel(hideAnimation) animatingBubble = null bubbleStashController.getStashedHandlePhysicsAnimator().cancelIfRunning() - bubbleBarView.onAnimatingBubbleCompleted() bubbleBarView.relativePivotY = 1f bubbleStashController.onNewBubbleAnimationInterrupted( /* isStashed= */ bubbleBarView.alpha == 0f, @@ -462,7 +460,6 @@ constructor( val hideAnimation = animatingBubble?.hideAnimation ?: return scheduler.cancel(hideAnimation) animatingBubble = null - bubbleBarView.onAnimatingBubbleCompleted() bubbleBarView.relativePivotY = 1f bubbleStashController.showBubbleBarImmediate() } 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 21eb3e0f7d..4da06e1286 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 @@ -98,7 +98,7 @@ class BubbleBarViewAnimatorTest { assertThat(bubbleBarView.scaleX).isEqualTo(1) assertThat(bubbleBarView.scaleY).isEqualTo(1) assertThat(bubbleBarView.translationY).isEqualTo(BAR_TRANSLATION_Y_FOR_TASKBAR) - assertThat(bubbleBarView.isAnimatingNewBubble).isTrue() + assertThat(animator.isAnimating).isTrue() // execute the hide bubble animation assertThat(animatorScheduler.delayedBlock).isNotNull() @@ -111,7 +111,7 @@ class BubbleBarViewAnimatorTest { assertThat(handle.alpha).isEqualTo(1) assertThat(handle.translationY).isEqualTo(0) assertThat(bubbleBarView.alpha).isEqualTo(0) - assertThat(bubbleBarView.isAnimatingNewBubble).isFalse() + assertThat(animator.isAnimating).isFalse() verify(bubbleStashController).stashBubbleBarImmediate() } @@ -142,7 +142,7 @@ class BubbleBarViewAnimatorTest { assertThat(bubbleBarView.scaleX).isEqualTo(1) assertThat(bubbleBarView.scaleY).isEqualTo(1) assertThat(bubbleBarView.translationY).isEqualTo(BAR_TRANSLATION_Y_FOR_TASKBAR) - assertThat(bubbleBarView.isAnimatingNewBubble).isTrue() + assertThat(animator.isAnimating).isTrue() verify(bubbleStashController, atLeastOnce()).updateTaskbarTouchRegion() @@ -155,7 +155,7 @@ class BubbleBarViewAnimatorTest { assertThat(bubbleBarView.alpha).isEqualTo(1) assertThat(bubbleBarView.visibility).isEqualTo(VISIBLE) assertThat(bubbleBarView.translationY).isEqualTo(BAR_TRANSLATION_Y_FOR_TASKBAR) - assertThat(bubbleBarView.isAnimatingNewBubble).isFalse() + assertThat(animator.isAnimating).isFalse() } @Test @@ -179,7 +179,7 @@ class BubbleBarViewAnimatorTest { PhysicsAnimatorTestUtils.blockUntilFirstAnimationFrameWhereTrue(handleAnimator) { true } handleAnimator.assertIsRunning() - assertThat(bubbleBarView.isAnimatingNewBubble).isTrue() + assertThat(animator.isAnimating).isTrue() // verify the hide bubble animation is pending assertThat(animatorScheduler.delayedBlock).isNotNull() @@ -189,7 +189,7 @@ class BubbleBarViewAnimatorTest { // verify that the hide animation was canceled assertThat(animatorScheduler.delayedBlock).isNull() - assertThat(bubbleBarView.isAnimatingNewBubble).isFalse() + assertThat(animator.isAnimating).isFalse() verify(bubbleStashController).onNewBubbleAnimationInterrupted(any(), any()) // PhysicsAnimatorTestUtils posts the cancellation to the main thread so we need to wait @@ -230,7 +230,7 @@ class BubbleBarViewAnimatorTest { animator.onStashStateChangingWhileAnimating() } - assertThat(bubbleBarView.isAnimatingNewBubble).isFalse() + assertThat(animator.isAnimating).isFalse() verify(bubbleStashController).onNewBubbleAnimationInterrupted(any(), any()) // PhysicsAnimatorTestUtils posts the cancellation to the main thread so we need to wait @@ -260,12 +260,12 @@ class BubbleBarViewAnimatorTest { PhysicsAnimatorTestUtils.blockUntilFirstAnimationFrameWhereTrue(handleAnimator) { true } handleAnimator.assertIsRunning() - assertThat(bubbleBarView.isAnimatingNewBubble).isTrue() + assertThat(animator.isAnimating).isTrue() assertThat(animatorScheduler.delayedBlock).isNotNull() handleAnimator.cancel() handleAnimator.assertIsNotRunning() - assertThat(bubbleBarView.isAnimatingNewBubble).isFalse() + assertThat(animator.isAnimating).isFalse() assertThat(animatorScheduler.delayedBlock).isNull() } @@ -296,7 +296,7 @@ class BubbleBarViewAnimatorTest { assertThat(bubbleBarView.scaleX).isEqualTo(1) assertThat(bubbleBarView.scaleY).isEqualTo(1) assertThat(bubbleBarView.translationY).isEqualTo(BAR_TRANSLATION_Y_FOR_TASKBAR) - assertThat(bubbleBarView.isAnimatingNewBubble).isFalse() + assertThat(animator.isAnimating).isFalse() assertThat(bubbleBarView.isExpanded).isTrue() // verify there is no hide animation @@ -326,7 +326,7 @@ class BubbleBarViewAnimatorTest { PhysicsAnimatorTestUtils.blockUntilFirstAnimationFrameWhereTrue(handleAnimator) { true } handleAnimator.assertIsRunning() - assertThat(bubbleBarView.isAnimatingNewBubble).isTrue() + assertThat(animator.isAnimating).isTrue() // verify the hide bubble animation is pending assertThat(animatorScheduler.delayedBlock).isNotNull() @@ -344,7 +344,7 @@ class BubbleBarViewAnimatorTest { assertThat(handle.translationY) .isEqualTo(DIFF_BETWEEN_HANDLE_AND_BAR_CENTERS + BAR_TRANSLATION_Y_FOR_TASKBAR) verifyBubbleBarIsExpandedWithTranslation(BAR_TRANSLATION_Y_FOR_TASKBAR) - assertThat(bubbleBarView.isAnimatingNewBubble).isFalse() + assertThat(animator.isAnimating).isFalse() } @Test @@ -368,7 +368,7 @@ class BubbleBarViewAnimatorTest { // wait for the animation to end PhysicsAnimatorTestUtils.blockUntilAnimationsEnd(DynamicAnimation.TRANSLATION_Y) - assertThat(bubbleBarView.isAnimatingNewBubble).isTrue() + assertThat(animator.isAnimating).isTrue() // verify the hide bubble animation is pending assertThat(animatorScheduler.delayedBlock).isNotNull() @@ -383,7 +383,7 @@ class BubbleBarViewAnimatorTest { assertThat(handle.translationY) .isEqualTo(DIFF_BETWEEN_HANDLE_AND_BAR_CENTERS + BAR_TRANSLATION_Y_FOR_TASKBAR) verifyBubbleBarIsExpandedWithTranslation(BAR_TRANSLATION_Y_FOR_TASKBAR) - assertThat(bubbleBarView.isAnimatingNewBubble).isFalse() + assertThat(animator.isAnimating).isFalse() } @Test @@ -410,7 +410,7 @@ class BubbleBarViewAnimatorTest { PhysicsAnimatorTestUtils.blockUntilAnimationsEnd(DynamicAnimation.TRANSLATION_Y) barAnimator.assertIsNotRunning() - assertThat(bubbleBarView.isAnimatingNewBubble).isTrue() + assertThat(animator.isAnimating).isTrue() assertThat(bubbleBarView.alpha).isEqualTo(1) assertThat(bubbleBarView.translationY).isEqualTo(BAR_TRANSLATION_Y_FOR_TASKBAR) @@ -421,7 +421,7 @@ class BubbleBarViewAnimatorTest { PhysicsAnimatorTestUtils.blockUntilAnimationsEnd(DynamicAnimation.TRANSLATION_Y) InstrumentationRegistry.getInstrumentation().waitForIdleSync() - assertThat(bubbleBarView.isAnimatingNewBubble).isFalse() + assertThat(animator.isAnimating).isFalse() assertThat(bubbleBarView.alpha).isEqualTo(0) assertThat(handle.translationY).isEqualTo(0) assertThat(handle.alpha).isEqualTo(1) @@ -453,7 +453,7 @@ class BubbleBarViewAnimatorTest { PhysicsAnimatorTestUtils.blockUntilAnimationsEnd(DynamicAnimation.TRANSLATION_Y) barAnimator.assertIsNotRunning() - assertThat(bubbleBarView.isAnimatingNewBubble).isFalse() + assertThat(animator.isAnimating).isFalse() assertThat(bubbleBarView.alpha).isEqualTo(1) assertThat(bubbleBarView.translationY).isEqualTo(BAR_TRANSLATION_Y_FOR_TASKBAR) @@ -481,14 +481,14 @@ class BubbleBarViewAnimatorTest { PhysicsAnimatorTestUtils.blockUntilAnimationsEnd(DynamicAnimation.TRANSLATION_Y) barAnimator.assertIsNotRunning() - assertThat(bubbleBarView.isAnimatingNewBubble).isTrue() + assertThat(animator.isAnimating).isTrue() assertThat(bubbleBarView.alpha).isEqualTo(1) assertThat(bubbleBarView.translationY).isEqualTo(BAR_TRANSLATION_Y_FOR_HOTSEAT) assertThat(animatorScheduler.delayedBlock).isNotNull() InstrumentationRegistry.getInstrumentation().runOnMainSync(animatorScheduler.delayedBlock!!) - assertThat(bubbleBarView.isAnimatingNewBubble).isFalse() + assertThat(animator.isAnimating).isFalse() assertThat(bubbleBarView.alpha).isEqualTo(1) assertThat(bubbleBarView.translationY).isEqualTo(BAR_TRANSLATION_Y_FOR_HOTSEAT) @@ -516,7 +516,7 @@ class BubbleBarViewAnimatorTest { PhysicsAnimatorTestUtils.blockUntilFirstAnimationFrameWhereTrue(bubbleBarAnimator) { true } bubbleBarAnimator.assertIsRunning() - assertThat(bubbleBarView.isAnimatingNewBubble).isTrue() + assertThat(animator.isAnimating).isTrue() // verify the hide bubble animation is pending assertThat(animatorScheduler.delayedBlock).isNotNull() @@ -531,7 +531,7 @@ class BubbleBarViewAnimatorTest { assertThat(animatorScheduler.delayedBlock).isNull() verifyBubbleBarIsExpandedWithTranslation(BAR_TRANSLATION_Y_FOR_HOTSEAT) - assertThat(bubbleBarView.isAnimatingNewBubble).isFalse() + assertThat(animator.isAnimating).isFalse() verify(bubbleStashController).showBubbleBarImmediate() } @@ -553,7 +553,7 @@ class BubbleBarViewAnimatorTest { InstrumentationRegistry.getInstrumentation().runOnMainSync {} PhysicsAnimatorTestUtils.blockUntilAnimationsEnd(DynamicAnimation.TRANSLATION_Y) - assertThat(bubbleBarView.isAnimatingNewBubble).isTrue() + assertThat(animator.isAnimating).isTrue() // verify the hide bubble animation is pending assertThat(animatorScheduler.delayedBlock).isNotNull() @@ -565,7 +565,7 @@ class BubbleBarViewAnimatorTest { assertThat(animatorScheduler.delayedBlock).isNull() verifyBubbleBarIsExpandedWithTranslation(BAR_TRANSLATION_Y_FOR_HOTSEAT) - assertThat(bubbleBarView.isAnimatingNewBubble).isFalse() + assertThat(animator.isAnimating).isFalse() } @Test @@ -586,7 +586,7 @@ class BubbleBarViewAnimatorTest { InstrumentationRegistry.getInstrumentation().runOnMainSync {} // verify we started animating - assertThat(bubbleBarView.isAnimatingNewBubble).isTrue() + assertThat(animator.isAnimating).isTrue() // advance the animation handler by the duration of the initial lift InstrumentationRegistry.getInstrumentation().runOnMainSync { @@ -601,7 +601,7 @@ class BubbleBarViewAnimatorTest { assertThat(animatorScheduler.delayedBlock).isNotNull() InstrumentationRegistry.getInstrumentation().runOnMainSync(animatorScheduler.delayedBlock!!) - assertThat(bubbleBarView.isAnimatingNewBubble).isFalse() + assertThat(animator.isAnimating).isFalse() // the bubble bar translation y should be back to its initial value assertThat(bubbleBarView.translationY).isEqualTo(BAR_TRANSLATION_Y_FOR_HOTSEAT) @@ -626,7 +626,7 @@ class BubbleBarViewAnimatorTest { InstrumentationRegistry.getInstrumentation().runOnMainSync {} // verify we started animating - assertThat(bubbleBarView.isAnimatingNewBubble).isTrue() + assertThat(animator.isAnimating).isTrue() // advance the animation handler by the duration of the initial lift InstrumentationRegistry.getInstrumentation().runOnMainSync { @@ -641,7 +641,7 @@ class BubbleBarViewAnimatorTest { // verify there is no hide animation assertThat(animatorScheduler.delayedBlock).isNull() - assertThat(bubbleBarView.isAnimatingNewBubble).isFalse() + assertThat(animator.isAnimating).isFalse() assertThat(bubbleBarView.translationY).isEqualTo(BAR_TRANSLATION_Y_FOR_HOTSEAT) assertThat(bubbleBarView.isExpanded).isTrue() verify(bubbleStashController).showBubbleBarImmediate() @@ -665,7 +665,7 @@ class BubbleBarViewAnimatorTest { InstrumentationRegistry.getInstrumentation().runOnMainSync {} // verify we started animating - assertThat(bubbleBarView.isAnimatingNewBubble).isTrue() + assertThat(animator.isAnimating).isTrue() // advance the animation handler by the duration of the initial lift InstrumentationRegistry.getInstrumentation().runOnMainSync { @@ -679,7 +679,7 @@ class BubbleBarViewAnimatorTest { // verify there is a pending hide animation assertThat(animatorScheduler.delayedBlock).isNotNull() - assertThat(bubbleBarView.isAnimatingNewBubble).isTrue() + assertThat(animator.isAnimating).isTrue() InstrumentationRegistry.getInstrumentation().runOnMainSync { animator.expandedWhileAnimating() @@ -691,7 +691,7 @@ class BubbleBarViewAnimatorTest { // verify that the hide animation was canceled assertThat(animatorScheduler.delayedBlock).isNull() - assertThat(bubbleBarView.isAnimatingNewBubble).isFalse() + assertThat(animator.isAnimating).isFalse() assertThat(bubbleBarView.translationY).isEqualTo(BAR_TRANSLATION_Y_FOR_HOTSEAT) assertThat(bubbleBarView.isExpanded).isTrue() verify(bubbleStashController).showBubbleBarImmediate() @@ -715,7 +715,7 @@ class BubbleBarViewAnimatorTest { InstrumentationRegistry.getInstrumentation().runOnMainSync {} // verify we started animating - assertThat(bubbleBarView.isAnimatingNewBubble).isTrue() + assertThat(animator.isAnimating).isTrue() // advance the animation handler by the duration of the initial lift InstrumentationRegistry.getInstrumentation().runOnMainSync { @@ -729,7 +729,7 @@ class BubbleBarViewAnimatorTest { // verify there is a pending hide animation assertThat(animatorScheduler.delayedBlock).isNotNull() - assertThat(bubbleBarView.isAnimatingNewBubble).isTrue() + assertThat(animator.isAnimating).isTrue() InstrumentationRegistry.getInstrumentation().runOnMainSync { animator.expandedWhileAnimating() @@ -738,7 +738,7 @@ class BubbleBarViewAnimatorTest { // verify that the hide animation was canceled assertThat(animatorScheduler.delayedBlock).isNull() - assertThat(bubbleBarView.isAnimatingNewBubble).isFalse() + assertThat(animator.isAnimating).isFalse() assertThat(bubbleBarView.translationY).isEqualTo(BAR_TRANSLATION_Y_FOR_HOTSEAT) assertThat(bubbleBarView.isExpanded).isTrue() verify(bubbleStashController).showBubbleBarImmediate()