Enqueue: Removed unneeded dialog-entries and strings + adjustments
This commit is contained in:
parent
ed6fc4d848
commit
12f615c6da
61 changed files with 29 additions and 155 deletions
|
|
@ -196,6 +196,7 @@ public final class NavigationHelper {
|
|||
final boolean selectOnAppend,
|
||||
final boolean resumePlayback) {
|
||||
|
||||
Toast.makeText(context, R.string.player_append, Toast.LENGTH_SHORT).show();
|
||||
final Intent intent = getPlayerEnqueueIntent(
|
||||
context, MainPlayer.class, queue, selectOnAppend, resumePlayback);
|
||||
|
||||
|
|
@ -216,7 +217,7 @@ public final class NavigationHelper {
|
|||
return;
|
||||
}
|
||||
|
||||
Toast.makeText(context, R.string.popup_playing_append, Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(context, R.string.player_append, Toast.LENGTH_SHORT).show();
|
||||
final Intent intent = getPlayerEnqueueIntent(
|
||||
context, MainPlayer.class, queue, selectOnAppend, resumePlayback);
|
||||
intent.putExtra(VideoPlayer.PLAYER_TYPE, VideoPlayer.PLAYER_TYPE_POPUP);
|
||||
|
|
@ -232,7 +233,7 @@ public final class NavigationHelper {
|
|||
final PlayQueue queue,
|
||||
final boolean selectOnAppend,
|
||||
final boolean resumePlayback) {
|
||||
Toast.makeText(context, R.string.background_player_append, Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(context, R.string.player_append, Toast.LENGTH_SHORT).show();
|
||||
final Intent intent = getPlayerEnqueueIntent(
|
||||
context, MainPlayer.class, queue, selectOnAppend, resumePlayback);
|
||||
intent.putExtra(VideoPlayer.PLAYER_TYPE, VideoPlayer.PLAYER_TYPE_AUDIO);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package org.schabi.newpipe.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
|
|
@ -12,8 +11,11 @@ import org.schabi.newpipe.player.MainPlayer;
|
|||
import org.schabi.newpipe.player.helper.PlayerHolder;
|
||||
import org.schabi.newpipe.player.playqueue.SinglePlayQueue;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static org.schabi.newpipe.player.MainPlayer.PlayerType.AUDIO;
|
||||
import static org.schabi.newpipe.player.MainPlayer.PlayerType.POPUP;
|
||||
|
||||
public enum StreamDialogEntry {
|
||||
//////////////////////////////////////
|
||||
|
|
@ -25,45 +27,21 @@ public enum StreamDialogEntry {
|
|||
* <br>
|
||||
* Info: Add this entry within showStreamDialog.
|
||||
*/
|
||||
enqueue_stream(R.string.enqueue_stream, (fragment, item) -> {
|
||||
enqueue(R.string.enqueue_stream, (fragment, item) -> {
|
||||
final MainPlayer.PlayerType type = PlayerHolder.getType();
|
||||
|
||||
if (type == null) {
|
||||
// This code shouldn't be reached since the checks for appending this entry should be
|
||||
// done within the showStreamDialog calls.
|
||||
Toast.makeText(fragment.getContext(),
|
||||
"No player currently playing", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
switch (type) {
|
||||
case AUDIO:
|
||||
NavigationHelper.enqueueOnBackgroundPlayer(fragment.getContext(),
|
||||
new SinglePlayQueue(item), false);
|
||||
break;
|
||||
case POPUP:
|
||||
NavigationHelper.enqueueOnPopupPlayer(fragment.getContext(),
|
||||
new SinglePlayQueue(item), false);
|
||||
break;
|
||||
case VIDEO:
|
||||
NavigationHelper.enqueueOnVideoPlayer(fragment.getContext(),
|
||||
new SinglePlayQueue(item), false);
|
||||
break;
|
||||
default:
|
||||
// Same as above, but keep it for now for debugging.
|
||||
Toast.makeText(fragment.getContext(),
|
||||
"Unreachable code executed", Toast.LENGTH_SHORT).show();
|
||||
break;
|
||||
if (type == AUDIO) {
|
||||
NavigationHelper.enqueueOnBackgroundPlayer(fragment.getContext(),
|
||||
new SinglePlayQueue(item), false);
|
||||
} else if (type == POPUP) {
|
||||
NavigationHelper.enqueueOnPopupPlayer(fragment.getContext(),
|
||||
new SinglePlayQueue(item), false);
|
||||
} else /* type == VIDEO */ {
|
||||
NavigationHelper.enqueueOnVideoPlayer(fragment.getContext(),
|
||||
new SinglePlayQueue(item), false);
|
||||
}
|
||||
}),
|
||||
|
||||
enqueue_on_background(R.string.enqueue_on_background, (fragment, item) ->
|
||||
NavigationHelper.enqueueOnBackgroundPlayer(fragment.getContext(),
|
||||
new SinglePlayQueue(item), false)),
|
||||
|
||||
enqueue_on_popup(R.string.enqueue_on_popup, (fragment, item) ->
|
||||
NavigationHelper.enqueueOnPopupPlayer(fragment.getContext(),
|
||||
new SinglePlayQueue(item), false)),
|
||||
|
||||
start_here_on_background(R.string.start_here_on_background, (fragment, item) ->
|
||||
NavigationHelper.playOnBackgroundPlayer(fragment.getContext(),
|
||||
new SinglePlayQueue(item), true)),
|
||||
|
|
@ -109,7 +87,7 @@ public enum StreamDialogEntry {
|
|||
// non-static methods to initialize and edit entries //
|
||||
///////////////////////////////////////////////////////
|
||||
|
||||
public static void setEnabledEntries(final ArrayList<StreamDialogEntry> entries) {
|
||||
public static void setEnabledEntries(final List<StreamDialogEntry> entries) {
|
||||
setEnabledEntries(entries.toArray(new StreamDialogEntry[0]));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue