Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2de0282e authored by Mady Mellor's avatar Mady Mellor Committed by Automerger Merge Worker
Browse files

Merge "Skip onTaskMovedToFront if the bubble selection is animating" into...

Merge "Skip onTaskMovedToFront if the bubble selection is animating" into tm-dev am: 4008e21f am: 8c7e5226

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17769043



Change-Id: I6233dbee001e1f0b359f4c3ce0bff72a395a9367
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 275a7879 8c7e5226
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -385,7 +385,9 @@ public class BubbleController {
                mMainExecutor.execute(() -> {
                mMainExecutor.execute(() -> {
                    int expandedId = INVALID_TASK_ID;
                    int expandedId = INVALID_TASK_ID;
                    if (mStackView != null && mStackView.getExpandedBubble() != null
                    if (mStackView != null && mStackView.getExpandedBubble() != null
                            && isStackExpanded() && !mStackView.isExpansionAnimating()) {
                            && isStackExpanded()
                            && !mStackView.isExpansionAnimating()
                            && !mStackView.isSwitchAnimating()) {
                        expandedId = mStackView.getExpandedBubble().getTaskId();
                        expandedId = mStackView.getExpandedBubble().getTaskId();
                    }
                    }
                    if (expandedId != INVALID_TASK_ID && expandedId != taskId) {
                    if (expandedId != INVALID_TASK_ID && expandedId != taskId) {
+11 −0
Original line number Original line Diff line number Diff line
@@ -1607,6 +1607,13 @@ public class BubbleStackView extends FrameLayout
        return mIsExpansionAnimating;
        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.
     * 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) {
    private void dismissBubbleIfExists(@Nullable BubbleViewProvider bubble) {
        if (bubble != null && mBubbleData.hasBubbleInStackWithKey(bubble.getKey())) {
        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);
            mBubbleData.dismissBubbleWithKey(bubble.getKey(), Bubbles.DISMISS_USER_GESTURE);
        }
        }
    }
    }