diff options
author | Tom Hennen <TomHennen@users.noreply.github.com> | 2015-07-28 17:45:38 -0400 |
---|---|---|
committer | Tom Hennen <TomHennen@users.noreply.github.com> | 2015-07-28 17:45:38 -0400 |
commit | 8721dab1bccde56eb9697b5084df5fcdeb861b0a (patch) | |
tree | 0e3b6a2bf160b3d85ec6dbc6273f05d3409a5391 | |
parent | 65daa76d51b2301c183f70b20f3e5a26d80135ef (diff) | |
parent | b0c464d6ba2f0ed57a8255d7ae1999ef0f2e2acc (diff) | |
download | AntennaPod-8721dab1bccde56eb9697b5084df5fcdeb861b0a.zip |
Merge pull request #1037 from TomHennen/fix905
share titles with the URL. fixes AntennaPod/AntennaPod#905
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/util/ShareUtils.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/ShareUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/ShareUtils.java index c065a62c3..35916a604 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/ShareUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/ShareUtils.java @@ -21,11 +21,11 @@ public class ShareUtils { } public static void shareFeedlink(Context context, Feed feed) { - shareLink(context, feed.getLink()); + shareLink(context, feed.getTitle() + ": " + feed.getLink()); } public static void shareFeedDownloadLink(Context context, Feed feed) { - shareLink(context, feed.getDownload_url()); + shareLink(context, feed.getTitle() + ": " + feed.getDownload_url()); } public static void shareFeedItemLink(Context context, FeedItem item) { @@ -36,24 +36,24 @@ public class ShareUtils { shareFeedItemDownloadLink(context, item, false); } + private static String getItemShareText(FeedItem item) { + return item.getFeed().getTitle() + ": " + item.getTitle(); + } + public static void shareFeedItemLink(Context context, FeedItem item, boolean withPosition) { - String text; + String text = getItemShareText(item) + " " + item.getLink(); if(withPosition) { int pos = item.getMedia().getPosition(); text = item.getLink() + " [" + Converter.getDurationStringLong(pos) + "]"; - } else { - text = item.getLink(); } shareLink(context, text); } public static void shareFeedItemDownloadLink(Context context, FeedItem item, boolean withPosition) { - String text; + String text = getItemShareText(item) + " " + item.getMedia().getDownload_url(); if(withPosition) { int pos = item.getMedia().getPosition(); - text = item.getMedia().getDownload_url() + " [" + Converter.getDurationStringLong(pos) + "]"; - } else { - text = item.getMedia().getDownload_url(); + text += " [" + Converter.getDurationStringLong(pos) + "]"; } shareLink(context, text); } |