summaryrefslogtreecommitdiff
path: root/app/src/main/java/de
diff options
context:
space:
mode:
authorThom Merrilin <thom@caemlyn.org>2021-01-03 13:17:01 +0000
committerThom Merrilin <thom@caemlyn.org>2021-01-03 13:17:01 +0000
commitffc12060be9bb284255b7c9c37ce1581dfb2fb85 (patch)
tree60eed045646f86fe8b61e3784bf074e229cf70af /app/src/main/java/de
parent542dbd190c6aa4b01c1b644e5c107333817442cd (diff)
downloadAntennaPod-ffc12060be9bb284255b7c9c37ce1581dfb2fb85.zip
Added share icon to feed_info menu, moved the Website Address and Podcast Feed URL into a submenu of this icon.
Will resolve #4734 Details: Website Address and Podcast Feed URL menu options were previously always in the overflow menu, which is inconsistent with over menus such as the FeedList menu where these options are under a "Share..." submenu. Two new vector drawables were added for the black and white options of a "Share" icon, these are used to create a submenu for Website Address and Podcast Feed URL if there's room, otherwise the submenu text "Share..." is used in the overflow menu.
Diffstat (limited to 'app/src/main/java/de')
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/FeedInfoFragment.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/FeedInfoFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/FeedInfoFragment.java
index abb597e60..ddfcd06ad 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/FeedInfoFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/FeedInfoFragment.java
@@ -130,6 +130,8 @@ public class FeedInfoFragment extends Fragment implements Toolbar.OnMenuItemClic
protected void doTint(Context themedContext) {
toolbar.getMenu().findItem(R.id.visit_website_item)
.setIcon(ThemeUtils.getDrawableFromAttr(themedContext, R.attr.location_web_site));
+ toolbar.getMenu().findItem(R.id.share_parent)
+ .setIcon(ThemeUtils.getDrawableFromAttr(themedContext, R.attr.ic_share));
}
};
iconTintManager.updateTint();
@@ -284,9 +286,13 @@ public class FeedInfoFragment extends Fragment implements Toolbar.OnMenuItemClic
}
private void refreshToolbarState() {
+ boolean shareLinkVisible = feed != null && feed.getLink() != null;
+ boolean downloadUrlVisible = feed != null && !feed.isLocalFeed();
+
toolbar.getMenu().findItem(R.id.reconnect_local_folder).setVisible(feed != null && feed.isLocalFeed());
- toolbar.getMenu().findItem(R.id.share_download_url_item).setVisible(feed != null && !feed.isLocalFeed());
- toolbar.getMenu().findItem(R.id.share_link_item).setVisible(feed != null && feed.getLink() != null);
+ toolbar.getMenu().findItem(R.id.share_download_url_item).setVisible(downloadUrlVisible);
+ toolbar.getMenu().findItem(R.id.share_link_item).setVisible(shareLinkVisible);
+ toolbar.getMenu().findItem(R.id.share_parent).setVisible(downloadUrlVisible || shareLinkVisible);
toolbar.getMenu().findItem(R.id.visit_website_item).setVisible(feed != null && feed.getLink() != null
&& IntentUtils.isCallable(getContext(), new Intent(Intent.ACTION_VIEW, Uri.parse(feed.getLink()))));
}