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

Commit f9cdc734 authored by Mady Mellor's avatar Mady Mellor
Browse files

Fix an issue where the top bubble might not be correct

Regression from ag/27145767 -- need to also clear the magnetized
object in the click listener (not just the touch listener like that
change does).

Test: manual - 1 add some bubbles
             - 2 expand the stack, select a different bubble
             - 3 open the overflow, add a bubble
             - 4 collapse the stack
             =>  verify the bubble added in (3) is at the top of the stack
Bug: 339711720
Change-Id: I2090e0a365df39542676d5a9d0b98c85450f760e
parent c1513687
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -536,7 +536,8 @@ public class BubbleStackView extends FrameLayout
    private OnClickListener mBubbleClickListener = new OnClickListener() {
        @Override
        public void onClick(View view) {
            mIsDraggingStack = false; // If the touch ended in a click, we're no longer dragging.
            // If the touch ended in a click, we're no longer dragging.
            onDraggingEnded();

            // Bubble clicks either trigger expansion/collapse or a bubble switch, both of which we
            // shouldn't interrupt. These are quick transitions, so it's not worth trying to adjust
@@ -719,8 +720,7 @@ public class BubbleStackView extends FrameLayout
                mDismissView.hide();
            }

            mIsDraggingStack = false;
            mMagnetizedObject = null;
            onDraggingEnded();

            // Hide the stack after a delay, if needed.
            updateTemporarilyInvisibleAnimation(false /* hideImmediately */);
@@ -1096,6 +1096,7 @@ public class BubbleStackView extends FrameLayout
            } else {
                maybeShowStackEdu();
            }
            onDraggingEnded();
        });

        animate()
@@ -1152,6 +1153,14 @@ public class BubbleStackView extends FrameLayout
        });
    }

    /**
     * Reset state related to dragging.
     */
    private void onDraggingEnded() {
        mIsDraggingStack = false;
        mMagnetizedObject = null;
    }

    /**
     * Sets whether or not the stack should become temporarily invisible by moving off the side of
     * the screen.