From e327f7ba2c576525bd5f72519021a700f73bd81a Mon Sep 17 00:00:00 2001 From: Stypox Date: Tue, 19 Jan 2021 09:33:47 +0100 Subject: [PATCH] Fix popup closing x button animation --- .../main/java/org/schabi/newpipe/player/Player.java | 2 +- .../newpipe/player/event/PlayerGestureListener.java | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/Player.java b/app/src/main/java/org/schabi/newpipe/player/Player.java index 13a0a7d02..9d239e781 100644 --- a/app/src/main/java/org/schabi/newpipe/player/Player.java +++ b/app/src/main/java/org/schabi/newpipe/player/Player.java @@ -4003,7 +4003,7 @@ public final class Player implements } public View getClosingOverlayView() { - return closeOverlayBinding.getRoot(); + return binding.closingOverlay; } public ProgressBar getVolumeProgressBar() { diff --git a/app/src/main/java/org/schabi/newpipe/player/event/PlayerGestureListener.java b/app/src/main/java/org/schabi/newpipe/player/event/PlayerGestureListener.java index ecc57ff2f..c639bde9f 100644 --- a/app/src/main/java/org/schabi/newpipe/player/event/PlayerGestureListener.java +++ b/app/src/main/java/org/schabi/newpipe/player/event/PlayerGestureListener.java @@ -124,11 +124,11 @@ public class PlayerGestureListener final View closingOverlayView = player.getClosingOverlayView(); if (player.isInsideClosingRadius(movingEvent)) { if (closingOverlayView.getVisibility() == View.GONE) { - animate(closingOverlayView, true, 250); + animate(closingOverlayView, true, 200); } } else { if (closingOverlayView.getVisibility() == View.VISIBLE) { - animate(closingOverlayView, false, 0); + animate(closingOverlayView, false, 200); } } } @@ -234,12 +234,9 @@ public class PlayerGestureListener if (player.isInsideClosingRadius(event)) { player.closePopup(); - } else { - animate(player.getClosingOverlayView(), false, 0); - - if (!player.isPopupClosing()) { - animate(player.getCloseOverlayButton(), false, 200); - } + } else if (!player.isPopupClosing()) { + animate(player.getCloseOverlayButton(), false, 200); + animate(player.getClosingOverlayView(), false, 200); } } }