From bdb1be9967101c61689fff63c35842c7744c5890 Mon Sep 17 00:00:00 2001 From: Stypox Date: Wed, 29 May 2019 20:25:44 +0200 Subject: [PATCH] Remove useless overrides of showStreamDialog They were exactly the same as the base class function --- .../list/channel/ChannelFragment.java | 46 ------------------ .../list/playlist/PlaylistFragment.java | 47 ------------------- 2 files changed, 93 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java index 2cb4d2c5f..302adc610 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/channel/ChannelFragment.java @@ -150,52 +150,6 @@ public class ChannelFragment extends BaseListInfoFragment { return headerRootLayout; } - @Override - protected void showStreamDialog(final StreamInfoItem item) { - final Activity activity = getActivity(); - final Context context = getContext(); - 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.start_here_on_background), - context.getResources().getString(R.string.start_here_on_popup), - context.getResources().getString(R.string.append_playlist), - context.getResources().getString(R.string.share) - }; - - final DialogInterface.OnClickListener actions = (DialogInterface dialogInterface, int i) -> { - final int index = Math.max(infoListAdapter.getItemsList().indexOf(item), 0); - switch (i) { - case 0: - NavigationHelper.enqueueOnBackgroundPlayer(context, new SinglePlayQueue(item)); - break; - case 1: - NavigationHelper.enqueueOnPopupPlayer(activity, new SinglePlayQueue(item)); - break; - case 2: - NavigationHelper.playOnBackgroundPlayer(context, getPlayQueue(index)); - break; - case 3: - NavigationHelper.playOnPopupPlayer(activity, getPlayQueue(index)); - break; - case 4: - if (getFragmentManager() != null) { - PlaylistAppendDialog.fromStreamInfoItems(Collections.singletonList(item)) - .show(getFragmentManager(), TAG); - } - break; - case 5: - ShareUtils.shareUrl(this.getContext(), item.getName(), item.getUrl()); - break; - default: - break; - } - }; - - new InfoItemDialog(getActivity(), item, commands, actions).show(); - } /*////////////////////////////////////////////////////////////////////////// // Menu //////////////////////////////////////////////////////////////////////////*/ diff --git a/app/src/main/java/org/schabi/newpipe/fragments/list/playlist/PlaylistFragment.java b/app/src/main/java/org/schabi/newpipe/fragments/list/playlist/PlaylistFragment.java index f16bf0be4..c582d3ca2 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/list/playlist/PlaylistFragment.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/list/playlist/PlaylistFragment.java @@ -137,53 +137,6 @@ public class PlaylistFragment extends BaseListInfoFragment { infoListAdapter.useMiniItemVariants(true); } - @Override - 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.start_here_on_background), - context.getResources().getString(R.string.start_here_on_popup), - context.getResources().getString(R.string.append_playlist), - context.getResources().getString(R.string.share) - }; - - final DialogInterface.OnClickListener actions = (dialogInterface, i) -> { - final int index = Math.max(infoListAdapter.getItemsList().indexOf(item), 0); - switch (i) { - case 0: - NavigationHelper.enqueueOnBackgroundPlayer(context, new SinglePlayQueue(item)); - break; - case 1: - NavigationHelper.enqueueOnPopupPlayer(activity, new SinglePlayQueue(item)); - break; - case 2: - NavigationHelper.playOnBackgroundPlayer(context, getPlayQueue(index)); - break; - case 3: - NavigationHelper.playOnPopupPlayer(activity, getPlayQueue(index)); - break; - case 4: - if (getFragmentManager() != null) { - PlaylistAppendDialog.fromStreamInfoItems(Collections.singletonList(item)) - .show(getFragmentManager(), TAG); - } - break; - case 5: - ShareUtils.shareUrl(this.getContext(), item.getName(), item.getUrl()); - break; - default: - break; - } - }; - - new InfoItemDialog(getActivity(), item, commands, actions).show(); - } - @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { if (DEBUG) Log.d(TAG, "onCreateOptionsMenu() called with: menu = [" + menu +