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

Commit 04ab6405 authored by Joshua Tsuji's avatar Joshua Tsuji
Browse files

Prevent conflicting animations from starting.

This will prevent the stack from becoming separated and confused in some situations. The root cause was that the BubbleStackView returned false by default in its touch handler, which allowed the bubble views to grab touch events they shouldn't have and start animations. However, those bubbles trying to start the animations should have been prevented by the active controller logic, but it wasn't due to a missing check. Might as well fix both causes!

Also, cancel the path animator before starting a new one just in case.

Fixes: 155499044
Test: manual
Change-Id: Idbdb68dfe3cccc69ae3709faad8d3b7078b354a9
parent 4395bbdd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -879,7 +879,7 @@ public class BubbleStackView extends FrameLayout
                }
            }

            return false;
            return true;
        });
    }

+4 −0
Original line number Diff line number Diff line
@@ -767,6 +767,10 @@ public class PhysicsAnimationLayout extends FrameLayout {
                int targetAnimDuration,
                TimeInterpolator targetAnimInterpolator,
                Runnable... pathAnimEndActions) {
            if (mPathAnimator != null) {
                mPathAnimator.cancel();
            }

            mPathAnimator = ObjectAnimator.ofFloat(
                    this, mCurrentPointOnPathXProperty, mCurrentPointOnPathYProperty, path);

+5 −1
Original line number Diff line number Diff line
@@ -459,6 +459,10 @@ public class StackAnimationController extends
            float friction,
            SpringForce spring,
            Float finalPosition) {
        if (!isActiveController()) {
            return;
        }

        Log.d(TAG, String.format("Flinging %s.",
                PhysicsAnimationLayout.getReadablePropertyName(property)));

@@ -679,7 +683,7 @@ public class StackAnimationController extends
            DynamicAnimation.ViewProperty property, SpringForce spring,
            float vel, float finalPosition, @Nullable Runnable... after) {

        if (mLayout.getChildCount() == 0) {
        if (mLayout.getChildCount() == 0 || !isActiveController()) {
            return;
        }