diff options
author | Herbert Reiter <46045854+damoasda@users.noreply.github.com> | 2020-07-12 22:29:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-12 22:29:55 +0200 |
commit | 6a18c1978435ffb59d961caeffe18a869ee55ad1 (patch) | |
tree | f27b25f863b06c94d356c9a6f03d7a97a932e0c7 | |
parent | 984233d1d0c5950330b860446c75fa374d5cc139 (diff) | |
download | AntennaPod-6a18c1978435ffb59d961caeffe18a869ee55ad1.zip |
Multi select: handle local feeds
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java | 14 | ||||
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java | 8 |
2 files changed, 11 insertions, 11 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java b/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java index ac1e94437..8ae3f6079 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java @@ -51,7 +51,7 @@ public class EpisodesApplyActionFragment extends Fragment { private static final int ACTION_MARK_UNPLAYED = 8; public static final int ACTION_DOWNLOAD = 16; public static final int ACTION_DELETE = 32; - private static final int ACTION_ALL = ACTION_ADD_TO_QUEUE | ACTION_REMOVE_FROM_QUEUE + public static final int ACTION_ALL = ACTION_ADD_TO_QUEUE | ACTION_REMOVE_FROM_QUEUE | ACTION_MARK_PLAYED | ACTION_MARK_UNPLAYED | ACTION_DOWNLOAD | ACTION_DELETE; private Toolbar toolbar; @@ -103,10 +103,6 @@ public class EpisodesApplyActionFragment extends Fragment { ); } - public static EpisodesApplyActionFragment newInstance(List<FeedItem> items) { - return newInstance(items, ACTION_ALL); - } - public static EpisodesApplyActionFragment newInstance(List<FeedItem> items, int actions) { EpisodesApplyActionFragment f = new EpisodesApplyActionFragment(); f.episodes.addAll(items); @@ -449,7 +445,7 @@ public class EpisodesApplyActionFragment extends Fragment { // download the check episodes in the same order as they are currently displayed List<FeedItem> toDownload = new ArrayList<>(checkedIds.size()); for (FeedItem episode : episodes) { - if (checkedIds.contains(episode.getId()) && episode.hasMedia()) { + if (checkedIds.contains(episode.getId()) && episode.hasMedia() && !episode.getFeed().isLocalFeed()) { toDownload.add(episode); } } @@ -473,10 +469,8 @@ public class EpisodesApplyActionFragment extends Fragment { } private void close(@PluralsRes int msgId, int numItems) { - if (numItems > 0) { - ((MainActivity) getActivity()).showSnackbarAbovePlayer( - getResources().getQuantityString(msgId, numItems, numItems), Snackbar.LENGTH_LONG); - } + ((MainActivity) getActivity()).showSnackbarAbovePlayer( + getResources().getQuantityString(msgId, numItems, numItems), Snackbar.LENGTH_LONG); getActivity().getSupportFragmentManager().popBackStack(); } diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java index b90da7447..2ca591909 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java @@ -257,8 +257,14 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem if (!FeedMenuHandler.onOptionsItemClicked(getActivity(), item, feed)) { switch (item.getItemId()) { case R.id.episode_actions: + int actions = EpisodesApplyActionFragment.ACTION_ALL; + if (feed.isLocalFeed()) { + // turn off download and delete actions for local feed + actions ^= EpisodesApplyActionFragment.ACTION_DOWNLOAD; + actions ^= EpisodesApplyActionFragment.ACTION_DELETE; + } EpisodesApplyActionFragment fragment = EpisodesApplyActionFragment - .newInstance(feed.getItems()); + .newInstance(feed.getItems(), actions); ((MainActivity)getActivity()).loadChildFragment(fragment); return true; case R.id.rename_item: |