From f2aaff27a9cea42aba66da25f18d272c886300a0 Mon Sep 17 00:00:00 2001 From: Lyn Han Date: Thu, 8 Oct 2020 19:56:45 -0500 Subject: [PATCH] Chain stiffness for collapsed stack Bug: 168646300 Test: drag collapsed stack, let go => see expected distance between bubbles for spring and fling Change-Id: I0771f8c8db1a5dd449f6a1b9188ab8052f4dc8f8 --- .../bubbles/animation/StackAnimationController.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/animation/StackAnimationController.java b/packages/SystemUI/src/com/android/systemui/bubbles/animation/StackAnimationController.java index b7490a52f475a..4c902b99d4ea9 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/animation/StackAnimationController.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/animation/StackAnimationController.java @@ -72,9 +72,9 @@ public class StackAnimationController extends /** * Values to use for the default {@link SpringForce} provided to the physics animation layout. */ - public static final int DEFAULT_STIFFNESS = 12000; + public static final int SPRING_TO_TOUCH_STIFFNESS = 12000; public static final float IME_ANIMATION_STIFFNESS = SpringForce.STIFFNESS_LOW; - private static final int FLING_FOLLOW_STIFFNESS = 500; + private static final int CHAIN_STIFFNESS = 600; public static final float DEFAULT_BOUNCINESS = 0.9f; private final PhysicsAnimator.SpringConfig mAnimateOutSpringConfig = @@ -629,7 +629,7 @@ public class StackAnimationController extends public void moveStackFromTouch(float x, float y) { // Begin the spring-to-touch catch up animation if needed. if (mSpringToTouchOnNextMotionEvent) { - springStack(x, y, DEFAULT_STIFFNESS); + springStack(x, y, SPRING_TO_TOUCH_STIFFNESS); mSpringToTouchOnNextMotionEvent = false; mFirstBubbleSpringingToTouch = true; } else if (mFirstBubbleSpringingToTouch) { @@ -762,14 +762,12 @@ public class StackAnimationController extends @Override SpringForce getSpringForce(DynamicAnimation.ViewProperty property, View view) { final ContentResolver contentResolver = mLayout.getContext().getContentResolver(); - final float stiffness = Settings.Secure.getFloat(contentResolver, "bubble_stiffness", - mIsMovingFromFlinging ? FLING_FOLLOW_STIFFNESS : DEFAULT_STIFFNESS /* default */); final float dampingRatio = Settings.Secure.getFloat(contentResolver, "bubble_damping", DEFAULT_BOUNCINESS); return new SpringForce() .setDampingRatio(dampingRatio) - .setStiffness(stiffness); + .setStiffness(CHAIN_STIFFNESS); } @Override