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

Commit 73a55f75 authored by Mady Mellor's avatar Mady Mellor Committed by Android (Google) Code Review
Browse files

Merge "Fix for edge swipe/fling to minimize"

parents 2388f0c8 84a0f893
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -580,10 +580,10 @@ public class PipTouchHandler implements TunerService.Tunable {
                final float velocity = PointF.length(vel.x, vel.y);
                final boolean isFling = velocity > mFlingAnimationUtils.getMinVelocityPxPerSecond();
                final boolean isHorizontal = Math.abs(vel.x) > Math.abs(vel.y);
                final boolean onLeft = mMotionHelper.getBounds().left < mMovementBounds.centerX();
                final boolean isFlingToBot = !isHorizontal && mMovementWithinDismiss && vel.y > 0;
                final boolean isFlingToEdge = isHorizontal && mMovementWithinMinimize
                        && (onLeft ? vel.x < 0 : vel.x > 0);
                final boolean isFlingToBot = isFling
                        && !isHorizontal && mMovementWithinDismiss && vel.y > 0;
                final boolean isFlingToEdge = isFling && isHorizontal && mMovementWithinMinimize
                        && (mStartedOnLeft ? vel.x < 0 : vel.x > 0);

                if (ENABLE_DISMISS_DRAG_TO_EDGE
                        && (mMotionHelper.shouldDismissPip() || isFlingToBot)) {