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

Commit f75ca279 authored by Joshua Tsuji's avatar Joshua Tsuji
Browse files

Only cancel translation animations when setting stack position.

Cancelling all animations also cancels scale-in animations, resulting in adorable tiny bubbles. Which is a bad thing.

Test: atest SystemUITests
Fixes: 138801505
Change-Id: I68b5741848df7890730ba619baa726a53c50c714
parent 888ae369
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -407,8 +407,18 @@ public class PhysicsAnimationLayout extends FrameLayout {
            return;
        }

        cancelAllAnimationsOfProperties(
                mController.getAnimatedProperties().toArray(new DynamicAnimation.ViewProperty[]{}));
    }

    /** Cancels all animations that are running on all child views, for the given properties. */
    public void cancelAllAnimationsOfProperties(DynamicAnimation.ViewProperty... properties) {
        if (mController == null) {
            return;
        }

        for (int i = 0; i < getChildCount(); i++) {
            for (DynamicAnimation.ViewProperty property : mController.getAnimatedProperties()) {
            for (DynamicAnimation.ViewProperty property : properties) {
                final DynamicAnimation anim = getAnimationAtIndex(property, i);
                if (anim != null) {
                    anim.cancel();
+3 −1
Original line number Diff line number Diff line
@@ -757,7 +757,9 @@ public class StackAnimationController extends

        // If we're not the active controller, we don't want to physically move the bubble views.
        if (isActiveController()) {
            mLayout.cancelAllAnimations();
            // Cancel animations that could be moving the views.
            mLayout.cancelAllAnimationsOfProperties(
                    DynamicAnimation.TRANSLATION_X, DynamicAnimation.TRANSLATION_Y);
            cancelStackPositionAnimations();

            // Since we're not using the chained animations, apply the offsets manually.