1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-24 09:00:31 +00:00

Added share option to long tap menu

This commit is contained in:
Somethingweirdhere 2018-06-05 19:48:31 +02:00
parent ee347e3081
commit baa63249d1
6 changed files with 28 additions and 4 deletions

View File

@ -540,7 +540,8 @@ public class VideoDetailFragment
final String[] commands = new String[]{ final String[] commands = new String[]{
context.getResources().getString(R.string.enqueue_on_background), context.getResources().getString(R.string.enqueue_on_background),
context.getResources().getString(R.string.enqueue_on_popup), context.getResources().getString(R.string.enqueue_on_popup),
context.getResources().getString(R.string.append_playlist) context.getResources().getString(R.string.append_playlist),
context.getResources().getString(R.string.share)
}; };
final DialogInterface.OnClickListener actions = (DialogInterface dialogInterface, int i) -> { final DialogInterface.OnClickListener actions = (DialogInterface dialogInterface, int i) -> {
@ -557,6 +558,9 @@ public class VideoDetailFragment
.show(getFragmentManager(), TAG); .show(getFragmentManager(), TAG);
} }
break; break;
case 3:
shareUrl(item.getName(), item.getUrl());
break;
default: default:
break; break;
} }

View File

@ -196,7 +196,8 @@ public abstract class BaseListFragment<I, N> extends BaseStateFragment<I> implem
final String[] commands = new String[]{ final String[] commands = new String[]{
context.getResources().getString(R.string.enqueue_on_background), context.getResources().getString(R.string.enqueue_on_background),
context.getResources().getString(R.string.enqueue_on_popup), context.getResources().getString(R.string.enqueue_on_popup),
context.getResources().getString(R.string.append_playlist) context.getResources().getString(R.string.append_playlist),
context.getResources().getString(R.string.share)
}; };
final DialogInterface.OnClickListener actions = (dialogInterface, i) -> { final DialogInterface.OnClickListener actions = (dialogInterface, i) -> {
@ -213,6 +214,9 @@ public abstract class BaseListFragment<I, N> extends BaseStateFragment<I> implem
.show(getFragmentManager(), TAG); .show(getFragmentManager(), TAG);
} }
break; break;
case 3:
shareUrl(item.getName(), item.getUrl());
break;
default: default:
break; break;
} }

View File

@ -161,7 +161,8 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
context.getResources().getString(R.string.start_here_on_main), context.getResources().getString(R.string.start_here_on_main),
context.getResources().getString(R.string.start_here_on_background), context.getResources().getString(R.string.start_here_on_background),
context.getResources().getString(R.string.start_here_on_popup), context.getResources().getString(R.string.start_here_on_popup),
context.getResources().getString(R.string.append_playlist) context.getResources().getString(R.string.append_playlist),
context.getResources().getString(R.string.share)
}; };
final DialogInterface.OnClickListener actions = new DialogInterface.OnClickListener() { final DialogInterface.OnClickListener actions = new DialogInterface.OnClickListener() {
@ -190,6 +191,9 @@ public class ChannelFragment extends BaseListInfoFragment<ChannelInfo> {
.show(getFragmentManager(), TAG); .show(getFragmentManager(), TAG);
} }
break; break;
case 6:
shareUrl(item.getName(), item.getUrl());
break;
default: default:
break; break;
} }

View File

@ -142,6 +142,7 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
context.getResources().getString(R.string.start_here_on_main), context.getResources().getString(R.string.start_here_on_main),
context.getResources().getString(R.string.start_here_on_background), context.getResources().getString(R.string.start_here_on_background),
context.getResources().getString(R.string.start_here_on_popup), context.getResources().getString(R.string.start_here_on_popup),
context.getResources().getString(R.string.share)
}; };
final DialogInterface.OnClickListener actions = (dialogInterface, i) -> { final DialogInterface.OnClickListener actions = (dialogInterface, i) -> {
@ -162,6 +163,9 @@ public class PlaylistFragment extends BaseListInfoFragment<PlaylistInfo> {
case 4: case 4:
NavigationHelper.playOnPopupPlayer(activity, getPlayQueue(index)); NavigationHelper.playOnPopupPlayer(activity, getPlayQueue(index));
break; break;
case 5:
shareUrl(item.getName(), item.getUrl());
break;
default: default:
break; break;
} }

View File

@ -298,6 +298,7 @@ public class StatisticsPlaylistFragment
context.getResources().getString(R.string.start_here_on_background), context.getResources().getString(R.string.start_here_on_background),
context.getResources().getString(R.string.start_here_on_popup), context.getResources().getString(R.string.start_here_on_popup),
context.getResources().getString(R.string.delete), context.getResources().getString(R.string.delete),
context.getResources().getString(R.string.share)
}; };
final DialogInterface.OnClickListener actions = (dialogInterface, i) -> { final DialogInterface.OnClickListener actions = (dialogInterface, i) -> {
@ -321,6 +322,9 @@ public class StatisticsPlaylistFragment
case 5: case 5:
deleteEntry(index); deleteEntry(index);
break; break;
case 6:
shareUrl(item.toStreamInfoItem().getName(), item.toStreamInfoItem().getUrl());
break;
default: default:
break; break;
} }

View File

@ -520,7 +520,8 @@ public class LocalPlaylistFragment extends BaseLocalListFragment<List<PlaylistSt
context.getResources().getString(R.string.start_here_on_background), context.getResources().getString(R.string.start_here_on_background),
context.getResources().getString(R.string.start_here_on_popup), context.getResources().getString(R.string.start_here_on_popup),
context.getResources().getString(R.string.set_as_playlist_thumbnail), context.getResources().getString(R.string.set_as_playlist_thumbnail),
context.getResources().getString(R.string.delete) context.getResources().getString(R.string.delete),
context.getResources().getString(R.string.share)
}; };
final DialogInterface.OnClickListener actions = (dialogInterface, i) -> { final DialogInterface.OnClickListener actions = (dialogInterface, i) -> {
@ -549,6 +550,9 @@ public class LocalPlaylistFragment extends BaseLocalListFragment<List<PlaylistSt
case 6: case 6:
deleteItem(item); deleteItem(item);
break; break;
case 7:
shareUrl(item.toStreamInfoItem().getName(), item.toStreamInfoItem().getUrl());
break;
default: default:
break; break;
} }