From 8a29cfbb7e109a82ba48dc24deacb54729edb4c2 Mon Sep 17 00:00:00 2001
From: Mauricio Colli <mauriciocolli@outlook.com>
Date: Tue, 21 Aug 2018 23:04:52 -0300
Subject: [PATCH] Remove popup shutdown gesture in favor of the new close
 overlay

---
 .../java/org/schabi/newpipe/player/PopupVideoPlayer.java   | 7 +------
 .../org/schabi/newpipe/player/helper/PlayerHelper.java     | 4 ----
 2 files changed, 1 insertion(+), 10 deletions(-)

diff --git a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java
index 2d943ea11..bf1669e6e 100644
--- a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java
+++ b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java
@@ -116,7 +116,6 @@ public final class PopupVideoPlayer extends Service {
     private FloatingActionButton closeOverlayButton;
     private WindowManager.LayoutParams closeOverlayLayoutParams;
 
-    private int shutdownFlingVelocity;
     private int tossFlingVelocity;
 
     private float screenWidth, screenHeight;
@@ -200,7 +199,6 @@ public final class PopupVideoPlayer extends Service {
         View rootView = View.inflate(this, R.layout.player_popup, null);
         playerImpl.setup(rootView);
 
-        shutdownFlingVelocity = PlayerHelper.getShutdownFlingVelocity(this);
         tossFlingVelocity = PlayerHelper.getTossFlingVelocity(this);
 
         updateScreenSize();
@@ -995,10 +993,7 @@ public final class PopupVideoPlayer extends Service {
 
             final float absVelocityX = Math.abs(velocityX);
             final float absVelocityY = Math.abs(velocityY);
-            if (absVelocityX > shutdownFlingVelocity) {
-                closePopup();
-                return true;
-            } else if (Math.max(absVelocityX, absVelocityY) > tossFlingVelocity) {
+            if (Math.max(absVelocityX, absVelocityY) > tossFlingVelocity) {
                 if (absVelocityX > tossFlingVelocity) popupLayoutParams.x = (int) velocityX;
                 if (absVelocityY > tossFlingVelocity) popupLayoutParams.y = (int) velocityY;
                 checkPositionBounds();
diff --git a/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java b/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java
index 275f488e3..ae187a834 100644
--- a/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java
+++ b/app/src/main/java/org/schabi/newpipe/player/helper/PlayerHelper.java
@@ -251,10 +251,6 @@ public class PlayerHelper {
         return true;
     }
 
-    public static int getShutdownFlingVelocity(@NonNull final Context context) {
-        return 6000;
-    }
-
     public static int getTossFlingVelocity(@NonNull final Context context) {
         return 2500;
     }