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

Commit 81bd659c authored by Mady Mellor's avatar Mady Mellor
Browse files

Fix bubble expanded view jumping to the left when switching bubbles

When the bubbles are shown vertically on the left side of the screen
and you tapped between them, the view would be misaligned for a bit
during the animation.

This was happening because the padding being applied to the view
didn't account for the space the pointer triangle took up.

The fix is to add the size of the pointer to the padding when
showing vertically on the left side.

Bug: 196444014
Test: manual - expand a bubble on a large screen on the left side
             - tap between the bubble and the overflow or other
               bubbles
            => observe that the expanded view doesn't jump a bit to
               the left
      manual - test switching between bubbles on phone, phone
               landscape (left & right sides), and tablet on the
               right side
            => observe that the animation looks correct
Change-Id: Icb3cd87843504ab31da8005fb72f36daae387d39
parent 83464b43
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -329,6 +329,11 @@ public class BubblePositioner {
                : mBubbleSize;
    }

    /** Size of the visible (non-overlapping) part of the pointer. */
    public int getPointerSize() {
        return mPointerHeight - mPointerOverlap;
    }

    /** The maximum number of bubbles that can be displayed comfortably on screen. */
    public int getMaxBubbles() {
        return mMaxBubbles;
@@ -367,7 +372,7 @@ public class BubblePositioner {
     * padding is added.
     */
    public int[] getExpandedViewContainerPadding(boolean onLeft, boolean isOverflow) {
        final int pointerTotalHeight = mPointerHeight - mPointerOverlap;
        final int pointerTotalHeight = getPointerSize();
        final int expandedViewLargeScreenInsetFurthestEdge =
                getExpandedViewLargeScreenInsetFurthestEdge(isOverflow);
        if (mIsLargeScreen) {
+4 −1
Original line number Diff line number Diff line
@@ -2887,7 +2887,10 @@ public class BubbleStackView extends FrameLayout
        PhysicsAnimator.getInstance(mAnimatingOutSurfaceContainer).cancel();
        mAnimatingOutSurfaceContainer.setScaleX(1f);
        mAnimatingOutSurfaceContainer.setScaleY(1f);
        mAnimatingOutSurfaceContainer.setTranslationX(mExpandedViewContainer.getPaddingLeft());
        final float translationX = mPositioner.showBubblesVertically() && mStackOnLeftOrWillBe
                ? mExpandedViewContainer.getPaddingLeft() + mPositioner.getPointerSize()
                : mExpandedViewContainer.getPaddingLeft();
        mAnimatingOutSurfaceContainer.setTranslationX(translationX);
        mAnimatingOutSurfaceContainer.setTranslationY(0);

        final int[] taskViewLocation =