Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.schabi.newpipe.local.dialog.PlaylistAppendDialog;
import org.schabi.newpipe.player.event.PlayerEventListener;
import org.schabi.newpipe.player.helper.PlaybackParameterDialog;
import org.schabi.newpipe.player.playqueue.PlayQueue;
import org.schabi.newpipe.player.playqueue.PlayQueueAdapter;
import org.schabi.newpipe.player.playqueue.PlayQueueItem;
import org.schabi.newpipe.player.playqueue.PlayQueueItemBuilder;
Expand Down Expand Up @@ -322,7 +323,6 @@ private void buildItemPopupMenu(final PlayQueueItem item, final View view) {
Menu.NONE, R.string.play_queue_remove);
remove.setOnMenuItemClickListener(menuItem -> {
if (player == null) return false;

final int index = player.getPlayQueue().indexOf(item);
if (index != -1) player.getPlayQueue().remove(index);
return true;
Expand All @@ -349,6 +349,13 @@ private void buildItemPopupMenu(final PlayQueueItem item, final View view) {
return true;
});

final MenuItem moveToNext = menu.getMenu().add(RECYCLER_ITEM_POPUP_MENU_GROUP_ID, 4,
Menu.NONE, R.string.moveToNext);
moveToNext.setOnMenuItemClickListener(menuItem -> {
moveToNext(item);
return true;
});

menu.show();
}

Expand Down Expand Up @@ -538,6 +545,16 @@ private void shareUrl(String subject, String url) {
startActivity(Intent.createChooser(intent, getString(R.string.share_dialog_title)));
}

////////////////////////////////////////////////////////////////////////////
// Move to Next
////////////////////////////////////////////////////////////////////////////
private void moveToNext(PlayQueueItem item) {
int fromIndex = player.getPlayQueue().indexOf(item);
int toIndex = player.getPlayQueue().getIndex() + 1;

player.getPlayQueue().move(fromIndex, toIndex);
}

////////////////////////////////////////////////////////////////////////////
// Binding Service Listener
////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -670,4 +687,4 @@ private void onMaybePlaybackAdapterChanged() {
itemsList.setAdapter(maybeNewAdapter);
}
}
}
}
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -560,5 +560,6 @@
<string name="downloads_storage_ask_title">Ask where to download</string>
<string name="downloads_storage_ask_summary">You will be asked where to save each download</string>
<string name="downloads_storage_ask_summary_kitkat">You will be asked where to save each download.\nEnable this option if you want download to the external SD Card</string>
<string name="moveToNext">Move to next</string>

</resources>