Skip to content

Commit

Permalink
Fix pause button is not focused on player control activation
Browse files Browse the repository at this point in the history
  • Loading branch information
Stypox committed Apr 21, 2020
1 parent aa1cc32 commit 0ec22c7
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ public boolean onKeyDown(final int keyCode, final KeyEvent event) {
}

if (!playerImpl.isControlsVisible()) {
playerImpl.playPauseButton.requestFocus();
playerImpl.showControlsThenHide();
showSystemUi();
return true;
Expand Down Expand Up @@ -1002,6 +1003,7 @@ public void onPlaying() {
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);
});

Expand All @@ -1014,6 +1016,7 @@ public void onPaused() {
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);
});

Expand Down Expand Up @@ -1294,6 +1297,7 @@ public boolean onSingleTapConfirmed(final MotionEvent e) {
if (playerImpl.isControlsVisible()) {
playerImpl.hideControls(150, 0);
} else {
playerImpl.playPauseButton.requestFocus();
playerImpl.showControlsThenHide();
showSystemUi();
}
Expand Down

0 comments on commit 0ec22c7

Please sign in to comment.