From 3dd63d03cb230d049ca69f68e0ee82b75eb26bfe Mon Sep 17 00:00:00 2001 From: DafabHoid Date: Sun, 29 Apr 2018 11:23:21 +0200 Subject: [PATCH] Double-tap the middle of the player screen to pause the video --- .../java/org/schabi/newpipe/player/MainVideoPlayer.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java index aedcdb791..e8654c946 100644 --- a/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java @@ -847,10 +847,12 @@ public final class MainVideoPlayer extends AppCompatActivity if (DEBUG) Log.d(TAG, "onDoubleTap() called with: e = [" + e + "]" + "rawXy = " + e.getRawX() + ", " + e.getRawY() + ", xy = " + e.getX() + ", " + e.getY()); if (!playerImpl.isPlaying()) return false; - if (e.getX() > playerImpl.getRootView().getWidth() / 2) { + if (e.getX() > playerImpl.getRootView().getWidth() * 2 / 3) { playerImpl.onFastForward(); - } else { + } else if (e.getX() < playerImpl.getRootView().getWidth() / 3) { playerImpl.onFastRewind(); + } else { + playerImpl.getPlayPauseButton().performClick(); } return true;