Remove popup shutdown gesture in favor of the new close overlay
This commit is contained in:
parent
a01d6eaf72
commit
8a29cfbb7e
2 changed files with 1 additions and 10 deletions
|
@ -116,7 +116,6 @@ public final class PopupVideoPlayer extends Service {
|
||||||
private FloatingActionButton closeOverlayButton;
|
private FloatingActionButton closeOverlayButton;
|
||||||
private WindowManager.LayoutParams closeOverlayLayoutParams;
|
private WindowManager.LayoutParams closeOverlayLayoutParams;
|
||||||
|
|
||||||
private int shutdownFlingVelocity;
|
|
||||||
private int tossFlingVelocity;
|
private int tossFlingVelocity;
|
||||||
|
|
||||||
private float screenWidth, screenHeight;
|
private float screenWidth, screenHeight;
|
||||||
|
@ -200,7 +199,6 @@ public final class PopupVideoPlayer extends Service {
|
||||||
View rootView = View.inflate(this, R.layout.player_popup, null);
|
View rootView = View.inflate(this, R.layout.player_popup, null);
|
||||||
playerImpl.setup(rootView);
|
playerImpl.setup(rootView);
|
||||||
|
|
||||||
shutdownFlingVelocity = PlayerHelper.getShutdownFlingVelocity(this);
|
|
||||||
tossFlingVelocity = PlayerHelper.getTossFlingVelocity(this);
|
tossFlingVelocity = PlayerHelper.getTossFlingVelocity(this);
|
||||||
|
|
||||||
updateScreenSize();
|
updateScreenSize();
|
||||||
|
@ -995,10 +993,7 @@ public final class PopupVideoPlayer extends Service {
|
||||||
|
|
||||||
final float absVelocityX = Math.abs(velocityX);
|
final float absVelocityX = Math.abs(velocityX);
|
||||||
final float absVelocityY = Math.abs(velocityY);
|
final float absVelocityY = Math.abs(velocityY);
|
||||||
if (absVelocityX > shutdownFlingVelocity) {
|
if (Math.max(absVelocityX, absVelocityY) > tossFlingVelocity) {
|
||||||
closePopup();
|
|
||||||
return true;
|
|
||||||
} else if (Math.max(absVelocityX, absVelocityY) > tossFlingVelocity) {
|
|
||||||
if (absVelocityX > tossFlingVelocity) popupLayoutParams.x = (int) velocityX;
|
if (absVelocityX > tossFlingVelocity) popupLayoutParams.x = (int) velocityX;
|
||||||
if (absVelocityY > tossFlingVelocity) popupLayoutParams.y = (int) velocityY;
|
if (absVelocityY > tossFlingVelocity) popupLayoutParams.y = (int) velocityY;
|
||||||
checkPositionBounds();
|
checkPositionBounds();
|
||||||
|
|
|
@ -251,10 +251,6 @@ public class PlayerHelper {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getShutdownFlingVelocity(@NonNull final Context context) {
|
|
||||||
return 6000;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int getTossFlingVelocity(@NonNull final Context context) {
|
public static int getTossFlingVelocity(@NonNull final Context context) {
|
||||||
return 2500;
|
return 2500;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue