diff options
| author | 2021-03-08 16:54:21 -0500 | |
|---|---|---|
| committer | 2021-03-08 16:55:06 -0500 | |
| commit | add6ea4e16fb48f33a8be50da2ee4d6d1f06c0b4 (patch) | |
| tree | 2504b31d717b450650a10c582441095b7218ad25 | |
| parent | d6209d4e1845c3689d614c0ccdf43271160f374f (diff) | |
Land PIP softly (using the same physics settings as Bubbles).
Test: fling a bunch of pips
Bug: 169863897
Change-Id: I115bcf7adc34852612646bd9cf220af62e06c4d3
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMotionHelper.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMotionHelper.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMotionHelper.java index d742aa688fe7..81a7ae1be482 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMotionHelper.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMotionHelper.java @@ -37,7 +37,6 @@ import androidx.dynamicanimation.animation.SpringForce; import com.android.wm.shell.animation.FloatProperties; import com.android.wm.shell.animation.PhysicsAnimator; import com.android.wm.shell.common.FloatingContentCoordinator; -import com.android.wm.shell.common.ShellExecutor; import com.android.wm.shell.common.magnetictarget.MagnetizedObject; import com.android.wm.shell.pip.PipBoundsState; import com.android.wm.shell.pip.PipSnapAlgorithm; @@ -64,8 +63,11 @@ public class PipMotionHelper implements PipAppOpsListener.Callback, private static final int LEAVE_PIP_DURATION = 300; private static final int SHIFT_DURATION = 300; + private static final float PIP_STIFFNESS = 700f; + private static final float PIP_DAMPING_RATIO = SpringForce.DAMPING_RATIO_NO_BOUNCY; + /** Friction to use for PIP when it moves via physics fling animations. */ - private static final float DEFAULT_FRICTION = 2f; + private static final float DEFAULT_FRICTION = 1.9f; private final Context mContext; private final PipTaskOrganizer mPipTaskOrganizer; @@ -119,13 +121,11 @@ public class PipMotionHelper implements PipAppOpsListener.Callback, /** SpringConfig to use for fling-then-spring animations. */ private final PhysicsAnimator.SpringConfig mSpringConfig = - new PhysicsAnimator.SpringConfig( - SpringForce.STIFFNESS_MEDIUM, SpringForce.DAMPING_RATIO_LOW_BOUNCY); + new PhysicsAnimator.SpringConfig(PIP_STIFFNESS, PIP_DAMPING_RATIO); /** SpringConfig to use for springing PIP away from conflicting floating content. */ private final PhysicsAnimator.SpringConfig mConflictResolutionSpringConfig = - new PhysicsAnimator.SpringConfig( - SpringForce.STIFFNESS_LOW, SpringForce.DAMPING_RATIO_LOW_BOUNCY); + new PhysicsAnimator.SpringConfig(SpringForce.STIFFNESS_LOW, PIP_DAMPING_RATIO); private final Consumer<Rect> mUpdateBoundsCallback = (Rect newBounds) -> { mMenuController.updateMenuLayout(newBounds); |