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

Commit 1c9bc0d3 authored by Lyn Han's avatar Lyn Han
Browse files

On bubble add, animate other bubbles to new Y

Bug: 158492043

Test: while collapsed, add new bubble (autoexpand=false)
  => other bubbles shift down

Change-Id: Ia588d8067c60d97b2134f9afb21d8ee004ba570e
parent a3e52bf4
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -980,19 +980,19 @@ public class StackAnimationController extends
            return;
        }

        final float xOffset =
                getOffsetForChainedPropertyAnimation(DynamicAnimation.TRANSLATION_X);
        final float yOffset =
                getOffsetForChainedPropertyAnimation(DynamicAnimation.TRANSLATION_Y);

        // Position the new bubble in the correct position, scaled down completely.
        child.setTranslationX(mStackPosition.x + xOffset * index);
        child.setTranslationY(mStackPosition.y);
        child.setTranslationX(mStackPosition.x);
        child.setTranslationY(mStackPosition.y + yOffset * index);
        child.setScaleX(0f);
        child.setScaleY(0f);

        // Push the subsequent views out of the way, if there are subsequent views.
        if (index + 1 < mLayout.getChildCount()) {
            animationForChildAtIndex(index + 1)
                    .translationX(mStackPosition.x + xOffset * (index + 1))
                    .translationY(mStackPosition.y + yOffset * (index + 1))
                    .withStiffness(SpringForce.STIFFNESS_LOW)
                    .start();
        }