From b7b4d29395847ae395c828cd31bd757d458d4fea Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 1 Jun 2017 12:31:14 +0300 Subject: [PATCH] when using flavor image overflow menu prefer stream URI is available for sharing etc --- .../src/main/java/org/fox/ttrss/HeadlinesFragment.java | 9 ++++++--- .../src/main/res/menu/context_article_content_img.xml | 4 ++-- org.fox.ttrss/src/main/res/values/strings.xml | 3 +-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java index 6f411418..5a90cc1a 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java @@ -1147,15 +1147,18 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { + + Uri mediaUri = Uri.parse(article.flavorStreamUri != null ? article.flavorStreamUri : article.flavorImageUri); + switch (item.getItemId()) { case R.id.article_img_open: - m_activity.openUri(Uri.parse(article.flavorImageUri)); + m_activity.openUri(mediaUri); return true; case R.id.article_img_copy: - m_activity.copyToClipboard(article.flavorImageUri); + m_activity.copyToClipboard(mediaUri.toString()); return true; case R.id.article_img_share: - m_activity.shareText(article.flavorImageUri); + m_activity.shareText(mediaUri.toString()); return true; case R.id.article_img_view_caption: m_activity.displayImageCaption(article.flavorImageUri, article.content); diff --git a/org.fox.ttrss/src/main/res/menu/context_article_content_img.xml b/org.fox.ttrss/src/main/res/menu/context_article_content_img.xml index 33b60653..67dbd6d8 100644 --- a/org.fox.ttrss/src/main/res/menu/context_article_content_img.xml +++ b/org.fox.ttrss/src/main/res/menu/context_article_content_img.xml @@ -12,8 +12,8 @@ + app:showAsAction="" + android:title="@string/article_media_share"/> Starred Published Unread - Open image - Share image + Share View Caption Mark read on scroll Headlines will be marked read when scrolling past them