mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-02 03:11:23 +01:00
Remove popup shutdown gesture in favor of the new close overlay
This commit is contained in:
parent
a01d6eaf72
commit
8a29cfbb7e
@ -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();
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user