From 0ec22c7a6e8f372efa6c9aa8833aa88e406e836d Mon Sep 17 00:00:00 2001 From: Stypox Date: Mon, 20 Apr 2020 21:11:56 +0200 Subject: [PATCH] Fix pause button is not focused on player control activation --- .../main/java/org/schabi/newpipe/player/MainVideoPlayer.java | 4 ++++ 1 file changed, 4 insertions(+) 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 3c373ba14..d2b1dbd59 100644 --- a/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java @@ -246,6 +246,7 @@ public final class MainVideoPlayer extends AppCompatActivity } if (!playerImpl.isControlsVisible()) { + playerImpl.playPauseButton.requestFocus(); playerImpl.showControlsThenHide(); showSystemUi(); return true; @@ -1002,6 +1003,7 @@ public final class MainVideoPlayer extends AppCompatActivity animateView(playPauseButton, AnimationUtils.Type.SCALE_AND_ALPHA, false, 80, 0, () -> { playPauseButton.setImageResource(R.drawable.ic_pause_white); animatePlayButtons(true, 200); + playPauseButton.requestFocus(); animateView(closeButton, false, DEFAULT_CONTROLS_DURATION); }); @@ -1014,6 +1016,7 @@ public final class MainVideoPlayer extends AppCompatActivity animateView(playPauseButton, AnimationUtils.Type.SCALE_AND_ALPHA, false, 80, 0, () -> { playPauseButton.setImageResource(R.drawable.ic_play_arrow_white); animatePlayButtons(true, 200); + playPauseButton.requestFocus(); animateView(closeButton, false, DEFAULT_CONTROLS_DURATION); }); @@ -1294,6 +1297,7 @@ public final class MainVideoPlayer extends AppCompatActivity if (playerImpl.isControlsVisible()) { playerImpl.hideControls(150, 0); } else { + playerImpl.playPauseButton.requestFocus(); playerImpl.showControlsThenHide(); showSystemUi(); }