summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorByteHamster <ByteHamster@users.noreply.github.com>2022-04-22 20:11:37 +0200
committerGitHub <noreply@github.com>2022-04-22 20:11:37 +0200
commita01c24984e90434924efb1199a1f39a99cb2f226 (patch)
tree5a872463b76c39d32fc1e4b4c89e3dd8c06f6ae3 /core/src
parent1dd6636a6144722282ea88c3f1e213a77ea4172e (diff)
downloadAntennaPod-a01c24984e90434924efb1199a1f39a99cb2f226.zip
Restore episode sharing that only includes a media URL (#5835)
Diffstat (limited to 'core/src')
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/util/ShareUtils.java24
1 files changed, 13 insertions, 11 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 482243826..13f2af762 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
@@ -32,24 +32,26 @@ public class ShareUtils {
context.startActivity(intent);
}
- public static void shareFeedlink(Context context, Feed feed) {
- shareLink(context, feed.getTitle() + ": " + feed.getLink());
- }
-
- public static void shareFeedDownloadLink(Context context, Feed feed) {
- shareLink(context, feed.getTitle() + ": " + feed.getDownload_url());
- }
-
- private static String getItemShareText(FeedItem item) {
- return item.getFeed().getTitle() + ": " + item.getTitle();
+ public static void shareFeedLink(Context context, Feed feed) {
+ String text = feed.getTitle();
+ if (feed.getLink() != null) {
+ text += "\n" + feed.getLink();
+ }
+ text += "\n\n" + context.getResources().getString(R.string.share_rss_address_label)
+ + " " + feed.getDownload_url();
+ shareLink(context, text);
}
public static boolean hasLinkToShare(FeedItem item) {
return FeedItemUtil.getLinkWithFallback(item) != null;
}
+ public static void shareMediaDownloadLink(Context context, FeedMedia media) {
+ shareLink(context, media.getDownload_url());
+ }
+
public static void shareFeedItemLinkWithDownloadLink(Context context, FeedItem item, boolean withPosition) {
- String text = getItemShareText(item);
+ String text = item.getFeed().getTitle() + ": " + item.getTitle();
int pos = 0;
if (item.getMedia() != null && withPosition) {
text += "\n" + context.getResources().getString(R.string.share_starting_position_label) + ": ";