mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-03 23:40:30 +01:00
Merge pull request #6844 from 0x416c6578/shuffle-mode-ui-fix
Fixed shuffle button opacity UI bug
This commit is contained in:
commit
2e862b4ccc
@ -774,6 +774,8 @@ public final class Player implements
|
|||||||
destroyPlayer();
|
destroyPlayer();
|
||||||
initPlayer(playOnReady);
|
initPlayer(playOnReady);
|
||||||
setRepeatMode(repeatMode);
|
setRepeatMode(repeatMode);
|
||||||
|
// #6825 - Ensure that the shuffle-button is in the correct state on the UI
|
||||||
|
setShuffleButton(binding.shuffleButton, simpleExoPlayer.getShuffleModeEnabled());
|
||||||
setPlaybackParameters(playbackSpeed, playbackPitch, playbackSkipSilence);
|
setPlaybackParameters(playbackSpeed, playbackPitch, playbackSkipSilence);
|
||||||
|
|
||||||
playQueue = queue;
|
playQueue = queue;
|
||||||
|
@ -436,14 +436,16 @@ public abstract class PlayQueue implements Serializable {
|
|||||||
* top, so shuffling a size-2 list does nothing)
|
* top, so shuffling a size-2 list does nothing)
|
||||||
*/
|
*/
|
||||||
public synchronized void shuffle() {
|
public synchronized void shuffle() {
|
||||||
// Can't shuffle an list that's empty or only has one element
|
|
||||||
if (size() <= 2) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Create a backup if it doesn't already exist
|
// Create a backup if it doesn't already exist
|
||||||
|
// Note: The backup-list has to be created at all cost (even when size <= 2).
|
||||||
|
// Otherwise it's not possible to enter shuffle-mode!
|
||||||
if (backup == null) {
|
if (backup == null) {
|
||||||
backup = new ArrayList<>(streams);
|
backup = new ArrayList<>(streams);
|
||||||
}
|
}
|
||||||
|
// Can't shuffle a list that's empty or only has one element
|
||||||
|
if (size() <= 2) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final int originalIndex = getIndex();
|
final int originalIndex = getIndex();
|
||||||
final PlayQueueItem currentItem = getItem();
|
final PlayQueueItem currentItem = getItem();
|
||||||
|
Loading…
Reference in New Issue
Block a user