diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2013-10-19 18:28:38 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2013-10-19 18:28:38 +0200 |
commit | 3c61058d07abc40e5908ccb7cd50bcdc53fce823 (patch) | |
tree | 8344661a177d607a51a3e9666cb21edf10380735 /src | |
parent | ddaf1adfe865599c450b9f123248296e0ed6e7f8 (diff) | |
download | AntennaPod-3c61058d07abc40e5908ccb7cd50bcdc53fce823.zip |
Fixed menu item visibility
Diffstat (limited to 'src')
4 files changed, 15 insertions, 22 deletions
diff --git a/src/de/danoeh/antennapod/activity/FeedInfoActivity.java b/src/de/danoeh/antennapod/activity/FeedInfoActivity.java index 78c466ae8..37932daf9 100644 --- a/src/de/danoeh/antennapod/activity/FeedInfoActivity.java +++ b/src/de/danoeh/antennapod/activity/FeedInfoActivity.java @@ -111,26 +111,18 @@ public class FeedInfoActivity extends ActionBarActivity { @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); - if (feed != null) { - MenuInflater inflater = getMenuInflater(); - inflater.inflate(R.menu.feedinfo, menu); - return true; - } else { - return false; - } + MenuInflater inflater = getMenuInflater(); + inflater.inflate(R.menu.feedinfo, menu); + return true; } @Override public boolean onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); - if (feed != null) { menu.findItem(R.id.support_item).setVisible( - feed.getPaymentLink() != null); - menu.findItem(R.id.share_link_item).setVisible(feed.getLink() != null); - return true; - } else { - return false; - } + feed != null && feed.getPaymentLink() != null); + menu.findItem(R.id.share_link_item).setVisible(feed != null &&feed.getLink() != null); + return true; } @Override diff --git a/src/de/danoeh/antennapod/activity/FeedItemlistActivity.java b/src/de/danoeh/antennapod/activity/FeedItemlistActivity.java index 44e755f51..78d6bcec4 100644 --- a/src/de/danoeh/antennapod/activity/FeedItemlistActivity.java +++ b/src/de/danoeh/antennapod/activity/FeedItemlistActivity.java @@ -152,11 +152,10 @@ public class FeedItemlistActivity extends ActionBarActivity { searchView.setSearchableInfo( searchManager.getSearchableInfo(getComponentName())); - return FeedMenuHandler + FeedMenuHandler .onCreateOptionsMenu(getMenuInflater(), menu); - } else { - return false; } + return true; } @Override diff --git a/src/de/danoeh/antennapod/activity/ItemviewActivity.java b/src/de/danoeh/antennapod/activity/ItemviewActivity.java index 887fb1d76..f08686004 100644 --- a/src/de/danoeh/antennapod/activity/ItemviewActivity.java +++ b/src/de/danoeh/antennapod/activity/ItemviewActivity.java @@ -146,14 +146,15 @@ public class ItemviewActivity extends ActionBarActivity { if (item != null) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.feeditem, menu); - return true; - } else { - return false; } + return true; } @Override public boolean onOptionsItemSelected(MenuItem menuItem) { + if (item == null) { + return false; + } try { if (!FeedItemMenuHandler.onMenuItemClicked(this, menuItem.getItemId(), item)) { @@ -175,7 +176,7 @@ public class ItemviewActivity extends ActionBarActivity { @Override public boolean onPrepareOptionsMenu(final Menu menu) { super.onPrepareOptionsMenu(menu); - return FeedItemMenuHandler.onPrepareMenu( + FeedItemMenuHandler.onPrepareMenu( new FeedItemMenuHandler.MenuInterface() { @Override @@ -183,6 +184,7 @@ public class ItemviewActivity extends ActionBarActivity { menu.findItem(id).setVisible(visible); } }, item, true, QueueAccess.NotInQueueAccess()); + return true; } private EventDistributor.EventListener contentUpdate = new EventDistributor.EventListener() { diff --git a/src/de/danoeh/antennapod/util/menuhandler/FeedMenuHandler.java b/src/de/danoeh/antennapod/util/menuhandler/FeedMenuHandler.java index 446e024d9..27b1a8a8c 100644 --- a/src/de/danoeh/antennapod/util/menuhandler/FeedMenuHandler.java +++ b/src/de/danoeh/antennapod/util/menuhandler/FeedMenuHandler.java @@ -31,7 +31,7 @@ public class FeedMenuHandler { public static boolean onPrepareOptionsMenu(Menu menu, Feed selectedFeed) { if (selectedFeed == null) { - return false; + return true; } if (AppConfig.DEBUG) |