Fix pause button is not focused on player control activation

This commit is contained in:
Stypox 2020-04-20 21:11:56 +02:00
parent aa1cc32d17
commit 0ec22c7a6e
No known key found for this signature in database
GPG key ID: 4BDF1B40A49FDD23

View file

@ -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();
}