summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mady Mellor <madym@google.com> 2017-03-27 23:26:47 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2017-03-27 23:26:52 +0000
commit73a55f7506f0e5e8d67a58259289ef0b97ccea02 (patch)
treecece052b6e2cff343a9c04b7981cceaaf0f88e00
parent2388f0c81c30274671d9ab28dde8cf36042d3214 (diff)
parent84a0f8936d0a993576a0da3a1c703e4f9198bfd3 (diff)
Merge "Fix for edge swipe/fling to minimize"
-rw-r--r--packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java b/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
index 5da30974ba7c..a0f491f3ba34 100644
--- a/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
+++ b/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
@@ -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)) {