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

Commit c53dd144 authored by Josh Tsuji's avatar Josh Tsuji Committed by Automerger Merge Worker
Browse files

Merge "Land PIP softly (using the same physics settings as Bubbles)." into sc-dev am: e3c41333

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13808782

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iee40a65199a7776f5764c0f0c1925987de38f280
parents 23e78432 e3c41333
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -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);