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

Commit 7aeac460 authored by Ben Lin's avatar Ben Lin
Browse files

If DismissDragToEdge is disabled, don't show Magnetized target.

Bug: 160791288
Test: Move PIP toward the bottom center, no longer see dismiss target
nor does the PIP window get smaller

Change-Id: I021bd0757e127040b36c912af92e3b7aec0d9af4
parent 0cf7f4da
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -272,7 +272,9 @@ public class PipTouchHandler {

        mMagnetizedPip.setAnimateStuckToTarget(
                (target, velX, velY, flung, after) -> {
                    if (mEnableDismissDragToEdge) {
                        mMotionHelper.animateIntoDismissTarget(target, velX, velY, flung, after);
                    }
                    return Unit.INSTANCE;
                });
        mMagnetizedPip.setMagnetListener(new MagnetizedObject.MagnetListener() {
@@ -280,8 +282,10 @@ public class PipTouchHandler {
            public void onStuckToTarget(@NonNull MagnetizedObject.MagneticTarget target) {
                // Show the dismiss target, in case the initial touch event occurred within the
                // magnetic field radius.
                if (mEnableDismissDragToEdge) {
                    showDismissTargetMaybe();
                }
            }

            @Override
            public void onUnstuckFromTarget(@NonNull MagnetizedObject.MagneticTarget target,