summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Josh Tsuji <tsuji@google.com> 2021-03-09 01:44:53 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2021-03-09 01:44:53 +0000
commite3c413337457d2b0b7d62071f4125d6e310f13ce (patch)
treeb427e7595b298d5a90c11f50feb8474e320d27c8
parent16f93725342149e3ae8cad65da058292f9995a2c (diff)
parentadd6ea4e16fb48f33a8be50da2ee4d6d1f06c0b4 (diff)
Merge "Land PIP softly (using the same physics settings as Bubbles)." into sc-dev
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMotionHelper.java12
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);