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

Commit 109c46bd authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix resting stack position + dot position issues." into qt-r1-bubbles-dev

parents f28a1448 b35f5918
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -692,10 +692,20 @@ public class BubbleStackView extends FrameLayout {
        if (DEBUG_BUBBLE_STACK_VIEW) {
            Log.d(TAG, "addBubble: " + bubble);
        }

        if (mBubbleContainer.getChildCount() == 0) {
            mStackOnLeftOrWillBe = mStackAnimationController.isStackOnLeftSide();
        }

        bubble.inflate(mInflater, this);
        bubble.getIconView().setBubbleIconFactory(mBubbleIconFactory);
        bubble.getIconView().updateViews();

        // Set the dot position to the opposite of the side the stack is resting on, since the stack
        // resting slightly off-screen would result in the dot also being off-screen.
        bubble.getIconView().setDotPosition(
                !mStackOnLeftOrWillBe /* onLeft */, false /* animate */);

        mBubbleContainer.addView(bubble.getIconView(), 0,
                new FrameLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT));
        ViewClippingUtil.setClippingDeactivated(bubble.getIconView(), true, mClippingParameters);
+3 −13
Original line number Diff line number Diff line
@@ -271,15 +271,6 @@ public class StackAnimationController extends
                        .setDampingRatio(SPRING_AFTER_FLING_DAMPING_RATIO),
                /* destination */ null);

        setEndActionForMultipleProperties(
                () -> {
                    mRestingStackPosition = new PointF();
                    mRestingStackPosition.set(mStackPosition);
                    removeEndActionForProperty(DynamicAnimation.TRANSLATION_X);
                    removeEndActionForProperty(DynamicAnimation.TRANSLATION_Y);
                },
                DynamicAnimation.TRANSLATION_X, DynamicAnimation.TRANSLATION_Y);

        // If we're flinging now, there's no more touch event to catch up to.
        mFirstBubbleSpringingToTouch = false;
        mIsMovingFromFlinging = true;
@@ -368,6 +359,9 @@ public class StackAnimationController extends

                .addEndListener((animation, canceled, endValue, endVelocity) -> {
                    if (!canceled) {
                        mRestingStackPosition = new PointF();
                        mRestingStackPosition.set(mStackPosition);

                        springFirstBubbleWithStackFollowing(property, spring, endVelocity,
                                finalPosition != null
                                        ? finalPosition
@@ -664,10 +658,6 @@ public class StackAnimationController extends

        if (mLayout.getChildCount() > 0) {
            animationForChildAtIndex(0).translationX(mStackPosition.x).start();
        } else {
            // Set the start position back to the default since we're out of bubbles. New bubbles
            // will then animate in from the start position.
            mStackPosition = getDefaultStartPosition();
        }
    }