1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-11 19:29:25 +01:00

Merge pull request #2198 from Redirion/directOnBackground

Directplay on Background
This commit is contained in:
Tobias Groza 2019-03-12 13:42:43 +01:00 committed by GitHub
commit f9e771f8f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -255,6 +255,7 @@ public abstract class BaseListFragment<I, N> extends BaseStateFragment<I> implem
if (context == null || context.getResources() == null || getActivity() == null) return;
final String[] commands = new String[]{
context.getResources().getString(R.string.direct_on_background),
context.getResources().getString(R.string.enqueue_on_background),
context.getResources().getString(R.string.enqueue_on_popup),
context.getResources().getString(R.string.append_playlist),
@ -264,18 +265,21 @@ public abstract class BaseListFragment<I, N> extends BaseStateFragment<I> implem
final DialogInterface.OnClickListener actions = (dialogInterface, i) -> {
switch (i) {
case 0:
NavigationHelper.enqueueOnBackgroundPlayer(context, new SinglePlayQueue(item));
NavigationHelper.playOnBackgroundPlayer(context, new SinglePlayQueue(item));
break;
case 1:
NavigationHelper.enqueueOnPopupPlayer(activity, new SinglePlayQueue(item));
NavigationHelper.enqueueOnBackgroundPlayer(context, new SinglePlayQueue(item));
break;
case 2:
NavigationHelper.enqueueOnPopupPlayer(activity, new SinglePlayQueue(item));
break;
case 3:
if (getFragmentManager() != null) {
PlaylistAppendDialog.fromStreamInfoItems(Collections.singletonList(item))
.show(getFragmentManager(), TAG);
}
break;
case 3:
case 4:
shareUrl(item.getName(), item.getUrl());
break;
default:

View File

@ -419,6 +419,7 @@
<string name="play_queue_stream_detail">Details</string>
<string name="play_queue_audio_settings">Audio Settings</string>
<string name="hold_to_append">Hold To enqueue</string>
<string name="direct_on_background">Play directly in Background</string>
<string name="enqueue_on_background">Enqueue when backgrounded</string>
<string name="enqueue_on_popup">Enqueue on new popup</string>
<string name="start_here_on_main">Start playing here</string>