Merge pull request #5301 from EricLemieux/fix-npe-play-button

Fix null pointer exception in play button method
pull/5334/head
Stypox 2020-12-30 17:48:40 +01:00 zatwierdzone przez GitHub
commit 8fe1a76ec6
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 18 dodań i 4 usunięć

Wyświetl plik

@ -1071,11 +1071,25 @@ public class VideoPlayerImpl extends VideoPlayer
private void animatePlayButtons(final boolean show, final int duration) {
animateView(playPauseButton, AnimationUtils.Type.SCALE_AND_ALPHA, show, duration);
if (playQueue.getIndex() > 0 || !show) {
animateView(playPreviousButton, AnimationUtils.Type.SCALE_AND_ALPHA, show, duration);
boolean showQueueButtons = show;
if (playQueue == null) {
showQueueButtons = false;
}
if (playQueue.getIndex() + 1 < playQueue.getStreams().size() || !show) {
animateView(playNextButton, AnimationUtils.Type.SCALE_AND_ALPHA, show, duration);
if (!showQueueButtons || playQueue.getIndex() > 0) {
animateView(
playPreviousButton,
AnimationUtils.Type.SCALE_AND_ALPHA,
showQueueButtons,
duration);
}
if (!showQueueButtons || playQueue.getIndex() + 1 < playQueue.getStreams().size()) {
animateView(
playNextButton,
AnimationUtils.Type.SCALE_AND_ALPHA,
showQueueButtons,
duration);
}
}