Remove BubbleBarView.mIsAnimatingNewBubble

We now use BubbleBarViewAnimator directly to check if there's a new
bubble animation.

Flag: com.android.wm.shell.enable_bubble_bar
Bug: 339683389
Test: presubmit
Change-Id: I5f884095125e6226338aee14d9d08e46b87ff2ec
This commit is contained in:
Liran Binyamin
2024-08-08 06:10:15 -04:00
parent 46111b109e
commit 09c2ad248b
4 changed files with 57 additions and 74 deletions
@@ -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;
}