diff options
author | Martin Fietz <Martin.Fietz@gmail.com> | 2016-01-21 13:57:21 +0100 |
---|---|---|
committer | Martin Fietz <Martin.Fietz@gmail.com> | 2016-01-21 13:57:21 +0100 |
commit | ab0782b45627d8e2cef5f25afd5c11072c1c616c (patch) | |
tree | b42ab05008262e5dd30ee5a90144baf3639351d5 /app/src/main/java/de/danoeh/antennapod/menuhandler | |
parent | 8ffe2caf3351d8000454ee6fda884e8ae001be0a (diff) | |
download | AntennaPod-ab0782b45627d8e2cef5f25afd5c11072c1c616c.zip |
Feed view: Add "Add/Remove to/from Favorites" to context menu
Diffstat (limited to 'app/src/main/java/de/danoeh/antennapod/menuhandler')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/menuhandler/FeedItemMenuHandler.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedItemMenuHandler.java b/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedItemMenuHandler.java index 0224d2c7e..55f522dfe 100644 --- a/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedItemMenuHandler.java +++ b/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedItemMenuHandler.java @@ -57,16 +57,16 @@ public class FeedItemMenuHandler { * @param queueAccess Used for testing if the queue contains the selected item * @return Returns true if selectedItem is not null. */ - public static boolean onPrepareMenu(Context context, MenuInterface mi, FeedItem selectedItem, - boolean showExtendedMenu, LongList queueAccess) { + public static boolean onPrepareMenu(MenuInterface mi, + FeedItem selectedItem, + boolean showExtendedMenu, + LongList queueAccess, + LongList favorites) { if (selectedItem == null) { return false; } boolean hasMedia = selectedItem.getMedia() != null; - boolean isPlaying = hasMedia - && selectedItem.getState() == FeedItem.State.PLAYING; - - FeedItem.State state = selectedItem.getState(); + boolean isPlaying = hasMedia && selectedItem.getState() == FeedItem.State.PLAYING; if (!isPlaying) { mi.setItemVisibility(R.id.skip_episode_item, false); @@ -126,7 +126,7 @@ public class FeedItemMenuHandler { mi.setItemVisibility(R.id.support_item, false); } - boolean isFavorite = selectedItem.isTagged(FeedItem.TAG_FAVORITE); + boolean isFavorite = favorites != null && favorites.contains(selectedItem.getId()); mi.setItemVisibility(R.id.add_to_favorites_item, !isFavorite); mi.setItemVisibility(R.id.remove_from_favorites_item, isFavorite); |