Small fixes of issues

This commit is contained in:
Avently 2020-07-13 23:28:39 +03:00
parent d2aaa6f691
commit bff238774e
5 changed files with 26 additions and 30 deletions

View file

@ -470,11 +470,6 @@ public class VideoDetailFragment
@Override
public void onSaveInstanceState(final Bundle outState) {
super.onSaveInstanceState(outState);
// Check if the next video label and video is visible,
// if it is, include the two elements in the next check
int nextCount = currentInfo != null && currentInfo.getNextVideo() != null ? 2 : 0;
if (!isLoading.get() && currentInfo != null && isVisible()) {
outState.putSerializable(INFO_KEY, currentInfo);
}
@ -947,12 +942,12 @@ public class VideoDetailFragment
getString(R.string.show_age_restricted_content), false)) {
hideAgeRestrictedContent();
} else {
currentInfo = result;
handleResult(result);
showContent();
if (addToBackStack) {
if (playQueue == null) playQueue = new SinglePlayQueue(result);
stack.push(new StackItem(serviceId, url, name, playQueue));
if (stack.isEmpty() || !stack.peek().getPlayQueue().equals(playQueue))
stack.push(new StackItem(serviceId, url, name, playQueue));
}
if (isAutoplayEnabled()) openVideoPlayer();
}

View file

@ -351,6 +351,7 @@ public class VideoPlayerImpl extends VideoPlayer
titleTextView.setVisibility(View.VISIBLE);
channelTextView.setVisibility(View.VISIBLE);
}
setMuteButton(muteButton, isMuted());
animateRotation(moreOptionsButton, DEFAULT_CONTROLS_DURATION, 0);
}
@ -960,12 +961,12 @@ public class VideoPlayerImpl extends VideoPlayer
@Override
public void onBlocked() {
super.onBlocked();
playPauseButton.setImageResource(R.drawable.exo_controls_play);
playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_24dp);
animatePlayButtons(false, 100);
getRootView().setKeepScreenOn(false);
service.resetNotification();
service.updateNotification(R.drawable.exo_controls_play);
service.updateNotification(R.drawable.ic_play_arrow_white_24dp);
}
@Override
@ -974,14 +975,14 @@ public class VideoPlayerImpl extends VideoPlayer
getRootView().setKeepScreenOn(true);
service.resetNotification();
service.updateNotification(R.drawable.exo_controls_play);
service.updateNotification(R.drawable.ic_play_arrow_white_24dp);
}
@Override
public void onPlaying() {
super.onPlaying();
animateView(playPauseButton, AnimationUtils.Type.SCALE_AND_ALPHA, false, 80, 0, () -> {
playPauseButton.setImageResource(R.drawable.exo_controls_pause);
playPauseButton.setImageResource(R.drawable.ic_pause_white_24dp);
animatePlayButtons(true, 200);
playPauseButton.requestFocus();
});
@ -991,7 +992,7 @@ public class VideoPlayerImpl extends VideoPlayer
getRootView().setKeepScreenOn(true);
service.resetNotification();
service.updateNotification(R.drawable.exo_controls_pause);
service.updateNotification(R.drawable.ic_pause_white_24dp);
service.startForeground(NOTIFICATION_ID, service.getNotBuilder().build());
}
@ -1000,7 +1001,7 @@ public class VideoPlayerImpl extends VideoPlayer
public void onPaused() {
super.onPaused();
animateView(playPauseButton, AnimationUtils.Type.SCALE_AND_ALPHA, false, 80, 0, () -> {
playPauseButton.setImageResource(R.drawable.exo_controls_play);
playPauseButton.setImageResource(R.drawable.ic_play_arrow_white_24dp);
animatePlayButtons(true, 200);
playPauseButton.requestFocus();
});
@ -1008,7 +1009,7 @@ public class VideoPlayerImpl extends VideoPlayer
updateWindowFlags(IDLE_WINDOW_FLAGS);
service.resetNotification();
service.updateNotification(R.drawable.exo_controls_play);
service.updateNotification(R.drawable.ic_play_arrow_white_24dp);
// Remove running notification when user don't want music (or video in popup) to be played in background
if (!minimizeOnPopupEnabled() && !backgroundPlaybackEnabled() && videoPlayerSelected())
@ -1024,7 +1025,7 @@ public class VideoPlayerImpl extends VideoPlayer
getRootView().setKeepScreenOn(true);
service.resetNotification();
service.updateNotification(R.drawable.exo_controls_play);
service.updateNotification(R.drawable.ic_play_arrow_white_24dp);
}

View file

@ -175,7 +175,11 @@ public class PlayerGestureListener extends GestureDetector.SimpleOnGestureListen
isMovingInMain = true;
if (isVolumeGestureEnabled && initialEvent.getX() > playerImpl.getRootView().getWidth() / 2.0) {
boolean acceptAnyArea = isVolumeGestureEnabled != isBrightnessGestureEnabled;
boolean acceptVolumeArea = acceptAnyArea
|| initialEvent.getX() > playerImpl.getRootView().getWidth() / 2.0;
if (isVolumeGestureEnabled && acceptVolumeArea) {
playerImpl.getVolumeProgressBar().incrementProgressBy((int) distanceY);
final float currentProgressPercent =
(float) playerImpl.getVolumeProgressBar().getProgress() / playerImpl.getMaxGestureLength();
@ -197,7 +201,7 @@ public class PlayerGestureListener extends GestureDetector.SimpleOnGestureListen
if (playerImpl.getBrightnessRelativeLayout().getVisibility() == View.VISIBLE) {
playerImpl.getBrightnessRelativeLayout().setVisibility(View.GONE);
}
} else if (isBrightnessGestureEnabled && initialEvent.getX() <= playerImpl.getRootView().getWidth() / 2.0) {
} else {
final Activity parent = playerImpl.getParentActivity();
if (parent == null) return true;