use of org.schabi.newpipe.info_list.InfoItemDialog in project NewPipe by TeamNewPipe.
the class BaseListFragment method showStreamDialog.
protected void showStreamDialog(final StreamInfoItem item) {
final Context context = getContext();
final Activity activity = getActivity();
if (context == null || context.getResources() == null || getActivity() == null)
return;
final String[] commands = new String[] { context.getResources().getString(R.string.enqueue_on_background), context.getResources().getString(R.string.enqueue_on_popup), context.getResources().getString(R.string.append_playlist) };
final DialogInterface.OnClickListener actions = (dialogInterface, i) -> {
switch(i) {
case 0:
NavigationHelper.enqueueOnBackgroundPlayer(context, new SinglePlayQueue(item));
break;
case 1:
NavigationHelper.enqueueOnPopupPlayer(activity, new SinglePlayQueue(item));
break;
case 2:
if (getFragmentManager() != null) {
PlaylistAppendDialog.fromStreamInfoItems(Collections.singletonList(item)).show(getFragmentManager(), TAG);
}
break;
default:
break;
}
};
new InfoItemDialog(getActivity(), item, commands, actions).show();
}
Aggregations