diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2014-07-13 10:31:13 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2014-07-13 10:31:13 +0200 |
commit | b87db6841955995d7963ae4899e7d404ab06da2e (patch) | |
tree | 030158eb4ce21cc74d3578c2d2c2ad71fb348330 /src/de/danoeh/antennapod/util/menuhandler | |
parent | af4929728fb0c43008cef6a659de45f32fe12788 (diff) | |
download | AntennaPod-b87db6841955995d7963ae4899e7d404ab06da2e.zip |
Added buttons to FeedItemDialog and the episode lists for items without an episode.
fixes #470, fixes #464
Diffstat (limited to 'src/de/danoeh/antennapod/util/menuhandler')
-rw-r--r-- | src/de/danoeh/antennapod/util/menuhandler/FeedItemMenuHandler.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/de/danoeh/antennapod/util/menuhandler/FeedItemMenuHandler.java b/src/de/danoeh/antennapod/util/menuhandler/FeedItemMenuHandler.java index 6733430da..2c7a7f074 100644 --- a/src/de/danoeh/antennapod/util/menuhandler/FeedItemMenuHandler.java +++ b/src/de/danoeh/antennapod/util/menuhandler/FeedItemMenuHandler.java @@ -3,6 +3,7 @@ package de.danoeh.antennapod.util.menuhandler; import android.content.Context; import android.content.Intent; import android.net.Uri; + import de.danoeh.antennapod.BuildConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.feed.FeedItem; @@ -113,6 +114,25 @@ public class FeedItemMenuHandler { return true; } + /** + * The same method as onPrepareMenu(MenuInterface, FeedItem, boolean, QueueAccess), but lets the + * caller also specify a list of menu items that should not be shown. + * + * @param excludeIds Menu item that should be excluded + * @return true if selectedItem is not null. + */ + public static boolean onPrepareMenu(MenuInterface mi, + FeedItem selectedItem, boolean showExtendedMenu, QueueAccess queueAccess, int... excludeIds) { + boolean rc = onPrepareMenu(mi, selectedItem, showExtendedMenu, queueAccess); + if (rc && excludeIds != null) { + for (int id : excludeIds) { + mi.setItemVisibility(id, false); + } + } + + return rc; + } + public static boolean onMenuItemClicked(Context context, int menuItemId, FeedItem selectedItem) throws DownloadRequestException { DownloadRequester requester = DownloadRequester.getInstance(); |