Fix repeat mode UI out-of-sync when switching videos
This commit is contained in:
parent
b1b0db6cdc
commit
2dd87e3b88
1 changed files with 18 additions and 0 deletions
|
|
@ -399,6 +399,10 @@ public abstract class VideoPlayerUi extends PlayerUi implements SeekBar.OnSeekBa
|
||||||
|
|
||||||
// #6825 - Ensure that the shuffle-button is in the correct state on the UI
|
// #6825 - Ensure that the shuffle-button is in the correct state on the UI
|
||||||
setShuffleButton(player.getExoPlayer().getShuffleModeEnabled());
|
setShuffleButton(player.getExoPlayer().getShuffleModeEnabled());
|
||||||
|
|
||||||
|
// Set repeat button to the correct UI state
|
||||||
|
setRepeatButton(player.getExoPlayer().getRepeatMode());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract void removeViewFromParent();
|
public abstract void removeViewFromParent();
|
||||||
|
|
@ -982,6 +986,20 @@ public abstract class VideoPlayerUi extends PlayerUi implements SeekBar.OnSeekBa
|
||||||
private void setShuffleButton(final boolean shuffled) {
|
private void setShuffleButton(final boolean shuffled) {
|
||||||
binding.shuffleButton.setImageAlpha(shuffled ? 255 : 77);
|
binding.shuffleButton.setImageAlpha(shuffled ? 255 : 77);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setRepeatButton(final int repeatMode) {
|
||||||
|
if (repeatMode == REPEAT_MODE_ALL) {
|
||||||
|
binding.repeatButton.setImageResource(
|
||||||
|
com.google.android.exoplayer2.ui.R.drawable.exo_controls_repeat_all);
|
||||||
|
} else if (repeatMode == REPEAT_MODE_ONE) {
|
||||||
|
binding.repeatButton.setImageResource(
|
||||||
|
com.google.android.exoplayer2.ui.R.drawable.exo_controls_repeat_one);
|
||||||
|
} else /* repeatMode == REPEAT_MODE_OFF */ {
|
||||||
|
binding.repeatButton.setImageResource(
|
||||||
|
com.google.android.exoplayer2.ui.R.drawable.exo_controls_repeat_off);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//endregion
|
//endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue