Merge "Skip onTaskMovedToFront if the bubble selection is animating" into tm-dev
This commit is contained in:
@@ -385,7 +385,9 @@ public class BubbleController {
|
||||
mMainExecutor.execute(() -> {
|
||||
int expandedId = INVALID_TASK_ID;
|
||||
if (mStackView != null && mStackView.getExpandedBubble() != null
|
||||
&& isStackExpanded() && !mStackView.isExpansionAnimating()) {
|
||||
&& isStackExpanded()
|
||||
&& !mStackView.isExpansionAnimating()
|
||||
&& !mStackView.isSwitchAnimating()) {
|
||||
expandedId = mStackView.getExpandedBubble().getTaskId();
|
||||
}
|
||||
if (expandedId != INVALID_TASK_ID && expandedId != taskId) {
|
||||
|
||||
@@ -1607,6 +1607,13 @@ public class BubbleStackView extends FrameLayout
|
||||
return mIsExpansionAnimating;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the stack of bubbles is animating a switch between bubbles.
|
||||
*/
|
||||
public boolean isSwitchAnimating() {
|
||||
return mIsBubbleSwitchAnimating;
|
||||
}
|
||||
|
||||
/**
|
||||
* The {@link Bubble} that is expanded, null if one does not exist.
|
||||
*/
|
||||
@@ -2467,6 +2474,10 @@ public class BubbleStackView extends FrameLayout
|
||||
|
||||
private void dismissBubbleIfExists(@Nullable BubbleViewProvider bubble) {
|
||||
if (bubble != null && mBubbleData.hasBubbleInStackWithKey(bubble.getKey())) {
|
||||
if (mIsExpanded && mBubbleData.getBubbles().size() > 1) {
|
||||
// If we have more than 1 bubble we will perform the switch animation
|
||||
mIsBubbleSwitchAnimating = true;
|
||||
}
|
||||
mBubbleData.dismissBubbleWithKey(bubble.getKey(), Bubbles.DISMISS_USER_GESTURE);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user