mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-23 08:30:44 +00:00
Merge pull request #8883 from Douile/dev-enqueue-next-hide
Only show "Enqueue next" when in the middle of the queue
This commit is contained in:
commit
281ac13eed
@ -252,10 +252,11 @@ public final class InfoItemDialog {
|
|||||||
* @return the current {@link Builder} instance
|
* @return the current {@link Builder} instance
|
||||||
*/
|
*/
|
||||||
public Builder addEnqueueEntriesIfNeeded() {
|
public Builder addEnqueueEntriesIfNeeded() {
|
||||||
if (PlayerHolder.getInstance().isPlayQueueReady()) {
|
final PlayerHolder holder = PlayerHolder.getInstance();
|
||||||
|
if (holder.isPlayQueueReady()) {
|
||||||
addEntry(StreamDialogDefaultEntry.ENQUEUE);
|
addEntry(StreamDialogDefaultEntry.ENQUEUE);
|
||||||
|
|
||||||
if (PlayerHolder.getInstance().getQueueSize() > 1) {
|
if (holder.getQueuePosition() < holder.getQueueSize() - 1) {
|
||||||
addEntry(StreamDialogDefaultEntry.ENQUEUE_NEXT);
|
addEntry(StreamDialogDefaultEntry.ENQUEUE_NEXT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,6 +92,13 @@ public final class PlayerHolder {
|
|||||||
return player.getPlayQueue().size();
|
return player.getPlayQueue().size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getQueuePosition() {
|
||||||
|
if (player == null || player.getPlayQueue() == null) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return player.getPlayQueue().getIndex();
|
||||||
|
}
|
||||||
|
|
||||||
public void setListener(@Nullable final PlayerServiceExtendedEventListener newListener) {
|
public void setListener(@Nullable final PlayerServiceExtendedEventListener newListener) {
|
||||||
listener = newListener;
|
listener = newListener;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user