summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorByteHamster <info@bytehamster.com>2017-04-18 10:50:47 +0200
committerByteHamster <info@bytehamster.com>2017-05-03 20:41:10 +0200
commit932f24c892306ece534a0027472b6939b5b85c91 (patch)
tree158be2d08eb7a2aede63ad6aa21befb7607d0359 /core
parent776f2234bef4046f61a2cc817ef0d53a229400de (diff)
downloadAntennaPod-932f24c892306ece534a0027472b6939b5b85c91.zip
Allow sharing feed file, as suggested in #2236
Diffstat (limited to 'core')
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/util/ShareUtils.java10
-rw-r--r--core/src/main/res/values/strings.xml1
2 files changed, 11 insertions, 0 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 35916a604..4193a7674 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
@@ -3,9 +3,13 @@ package de.danoeh.antennapod.core.util;
import android.content.Context;
import android.content.Intent;
+import android.net.Uri;
import de.danoeh.antennapod.core.R;
import de.danoeh.antennapod.core.feed.Feed;
import de.danoeh.antennapod.core.feed.FeedItem;
+import de.danoeh.antennapod.core.feed.FeedMedia;
+
+import java.io.File;
/** Utility methods for sharing data */
public class ShareUtils {
@@ -58,4 +62,10 @@ public class ShareUtils {
shareLink(context, text);
}
+ public static void shareFeedItemFile(Context context, FeedMedia media) {
+ Intent i = new Intent(Intent.ACTION_SEND);
+ i.setType(media.getMime_type());
+ i.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(media.getLocalMediaUrl())));
+ context.startActivity(Intent.createChooser(i, context.getString(R.string.share_file_label)));
+ }
}
diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml
index b82a03801..04a2f4f5c 100644
--- a/core/src/main/res/values/strings.xml
+++ b/core/src/main/res/values/strings.xml
@@ -126,6 +126,7 @@
<string name="remove_feed_label">Remove Podcast</string>
<string name="share_label">Share&#8230;</string>
<string name="share_link_label">Share Link</string>
+ <string name="share_file_label">Share file</string>
<string name="share_link_with_position_label">Share Link with Position</string>
<string name="share_feed_url_label">Share Feed URL</string>
<string name="share_item_url_label">Share Episode File URL</string>