From b0ba5a08f7423e5e75c25a638418444e9a7b8f27 Mon Sep 17 00:00:00 2001 From: Martin Fietz Date: Sat, 6 Jun 2015 00:05:19 +0200 Subject: Sharing in options and context menus --- .../de/danoeh/antennapod/core/util/ShareUtils.java | 56 ++++++++++++++++++---- core/src/main/res/values/strings.xml | 8 +++- 2 files changed, 52 insertions(+), 12 deletions(-) (limited to 'core/src') 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 85f32ed50..bc310ae21 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 @@ -2,6 +2,8 @@ package de.danoeh.antennapod.core.util; import android.content.Context; import android.content.Intent; + +import de.danoeh.antennapod.core.R; import de.danoeh.antennapod.core.feed.Feed; import de.danoeh.antennapod.core.feed.FeedItem; @@ -11,24 +13,58 @@ public class ShareUtils { private ShareUtils() {} - public static void shareLink(Context context, String link) { + public static void shareLink(Context context, String subject, String text) { Intent i = new Intent(Intent.ACTION_SEND); i.setType("text/plain"); - i.putExtra(Intent.EXTRA_SUBJECT, "Sharing URL"); - i.putExtra(Intent.EXTRA_TEXT, link); + i.putExtra(Intent.EXTRA_SUBJECT, subject); + i.putExtra(Intent.EXTRA_TEXT, text); context.startActivity(Intent.createChooser(i, "Share URL")); } - - public static void shareFeedItemLink(Context context, FeedItem item) { - shareLink(context, item.getLink()); + + public static void shareFeedlink(Context context, Feed feed) { + String subject = context.getString(R.string.share_link_label); + shareLink(context, subject, feed.getLink()); } public static void shareFeedDownloadLink(Context context, Feed feed) { - shareLink(context, feed.getDownload_url()); + String subject = context.getString(R.string.share_feed_url_label); + shareLink(context, subject, feed.getDownload_url()); } - - public static void shareFeedlink(Context context, Feed feed) { - shareLink(context, feed.getLink()); + + public static void shareFeedItemLink(Context context, FeedItem item) { + shareFeedItemLink(context, item, false); + } + + public static void shareFeedItemDownloadLink(Context context, FeedItem item) { + shareFeedItemDownloadLink(context, item, false); + } + + public static void shareFeedItemLink(Context context, FeedItem item, boolean withPosition) { + String subject; + String text; + if(withPosition) { + subject = context.getString(R.string.share_link_with_position_label); + int pos = item.getMedia().getPosition(); + text = item.getLink() + " [" + Converter.getDurationStringLong(pos) + "]"; + } else { + subject = context.getString(R.string.share_link_label); + text = item.getLink(); + } + shareLink(context, subject, text); + } + + public static void shareFeedItemDownloadLink(Context context, FeedItem item, boolean withPosition) { + String subject; + String text; + if(withPosition) { + subject = context.getString(R.string.share_item_url_with_position_label); + int pos = item.getMedia().getPosition(); + text = item.getMedia().getDownload_url() + " [" + Converter.getDurationStringLong(pos) + "]"; + } else { + subject = context.getString(R.string.share_item_url_label); + text = item.getMedia().getDownload_url(); + } + shareLink(context, subject, text); } } diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 3cedfb8e5..462e0657c 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -86,8 +86,12 @@ Please confirm that you want to mark all episodes in this feed as being played. Show information Remove podcast - Share website link - Share feed link + Share... + Share Link + Share Link with Position + Share Feed URL + Share Episode URL + Share Episode URL with Position Please confirm that you want to delete this feed and ALL episodes of this feed that you have downloaded. Removing feed Refresh complete feed -- cgit v1.2.3 From 8a9229ede62e9f1efef0e2ac102f1d7e930280b0 Mon Sep 17 00:00:00 2001 From: Martin Fietz Date: Sat, 6 Jun 2015 00:25:23 +0200 Subject: Capitalize titles --- .../de/danoeh/antennapod/core/util/ShareUtils.java | 21 ++-- core/src/main/res/values/strings.xml | 112 ++++++++++----------- 2 files changed, 62 insertions(+), 71 deletions(-) (limited to 'core/src') 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 bc310ae21..c065a62c3 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 @@ -13,22 +13,19 @@ public class ShareUtils { private ShareUtils() {} - public static void shareLink(Context context, String subject, String text) { + public static void shareLink(Context context, String text) { Intent i = new Intent(Intent.ACTION_SEND); i.setType("text/plain"); - i.putExtra(Intent.EXTRA_SUBJECT, subject); i.putExtra(Intent.EXTRA_TEXT, text); - context.startActivity(Intent.createChooser(i, "Share URL")); + context.startActivity(Intent.createChooser(i, context.getString(R.string.share_url_label))); } public static void shareFeedlink(Context context, Feed feed) { - String subject = context.getString(R.string.share_link_label); - shareLink(context, subject, feed.getLink()); + shareLink(context, feed.getLink()); } public static void shareFeedDownloadLink(Context context, Feed feed) { - String subject = context.getString(R.string.share_feed_url_label); - shareLink(context, subject, feed.getDownload_url()); + shareLink(context, feed.getDownload_url()); } public static void shareFeedItemLink(Context context, FeedItem item) { @@ -40,31 +37,25 @@ public class ShareUtils { } public static void shareFeedItemLink(Context context, FeedItem item, boolean withPosition) { - String subject; String text; if(withPosition) { - subject = context.getString(R.string.share_link_with_position_label); int pos = item.getMedia().getPosition(); text = item.getLink() + " [" + Converter.getDurationStringLong(pos) + "]"; } else { - subject = context.getString(R.string.share_link_label); text = item.getLink(); } - shareLink(context, subject, text); + shareLink(context, text); } public static void shareFeedItemDownloadLink(Context context, FeedItem item, boolean withPosition) { - String subject; String text; if(withPosition) { - subject = context.getString(R.string.share_item_url_with_position_label); int pos = item.getMedia().getPosition(); text = item.getMedia().getDownload_url() + " [" + Converter.getDurationStringLong(pos) + "]"; } else { - subject = context.getString(R.string.share_item_url_label); text = item.getMedia().getDownload_url(); } - shareLink(context, subject, text); + shareLink(context, text); } } diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 462e0657c..ac9255ac9 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -7,27 +7,27 @@ AntennaPod Feeds - Add podcast + Add Podcast PODCASTS EPISODES - New episodes - All episodes + New Episodes + All Episodes New - Waiting list + Waiting List Settings - Add podcast + Add Podcast Downloads Running Completed Log Cancel Download - Playback history + Playback History gpodder.net - gpodder.net login + gpodder.net Login Recently published - Show only new episodes + Show only new Episodes Open menu @@ -35,14 +35,14 @@ Drawer Preferences - Open in browser + Open in Browser Copy URL Share URL - Copied URL to clipboard. - Go to this position + Copied URL to Clipboard + Go to this Position - Clear history + Clear History Confirm @@ -59,7 +59,7 @@ Chapters Shownotes Description - Most Recent Episode:\u0020 + Most recent episode:\u0020 \u0020episodes Length:\u0020 Size:\u0020 @@ -75,17 +75,17 @@ Feed URL www.example.com/feed Add Podcast by URL - Find podcast in directory + Find Podcast in Directory You can search for new podcasts by name, category or popularity in the gpodder.net directory, or search the iTunes store. Browse gpodder.net Mark all as played - Marked all episodes as played + Marked all Episodes as played Please confirm that you want to mark all episodes as being played. Please confirm that you want to mark all episodes in this feed as being played. Show information - Remove podcast + Remove Podcast Share... Share Link Share Link with Position @@ -93,9 +93,9 @@ Share Episode URL Share Episode URL with Position Please confirm that you want to delete this feed and ALL episodes of this feed that you have downloaded. - Removing feed - Refresh complete feed - Hide episodes + Removing Feed + Refresh complete Feed + Hide Episodes Unplayed Paused Played @@ -104,7 +104,7 @@ Downloaded Not downloaded Filtered - {fa-exclamation-circle} Last refresh failed + {fa-exclamation-circle} Last Refresh failed Download @@ -113,7 +113,7 @@ Stop Stream Remove - Remove episode + Remove Episode Mark as played Mark as unplayed Marked as played @@ -125,39 +125,39 @@ Enqueue all Download all Skip episode - Activate auto download - Deactivate auto download - Reset playback position + Activate Auto Download + Deactivate Auto Download + Reset Playback Position successful failed Download pending Download running - Storage device not found - Insufficient space - File error + Storage Device not found + Insufficient Space + File Error HTTP Data Error Unknown Error Parser Exception - Unsupported Feed type - Connection error - Unknown host - Authentication error + Unsupported Feed Type + Connection Error + Unknown Host + Authentication Error Cancel all downloads Download canceled Download canceled\nDisabled Auto Download for this item Downloads completed with error(s) - Download report + Download Report Malformed URL IO Error - Request error - Database access error + Request Error + Database Access Error \u0020Downloads left Processing downloads Downloading podcast data %1$d downloads succeeded, %2$d failed - Unknown title + Unknown Title Feed Media file Image @@ -185,9 +185,9 @@ AntennaPod - Unknown media key: %1$d - Lock queue - Unlock queue - Clear queue + Lock Queue + Unlock Queue + Clear Queue Undo Item removed Move to top @@ -253,38 +253,38 @@ Smart mark as played Playback Network - Update interval + Update Interval Specify an interval in which the feeds are refreshed automatically or disable it Download media files only over WiFi - Continuous playback + Continuous Playback WiFi media download - Headphones disconnect - Headphones reconnect - Mobile updates + Headphones Disconnect + Headphones Reconnect + Mobile Updates Allow updates over the mobile data connection Refreshing Flattr settings Flattr sign-in Sign in to your flattr account to flattr things directly from the app. - Flattr this app + Flattr this App Support the development of AntennaPod by flattring it. Thanks! Revoke access Revoke the access permission to your flattr account for this app. Automatic Flattr Configure automatic flattring User Interface - Select theme - Change navigation drawer + Select Theme + Change Navigation Drawer Change which items appear in the navigation drawer. Change the appearance of AntennaPod. - Automatic download + Automatic Download Configure the automatic download of episodes. Enable Wi-Fi filter Allow automatic download only for selected Wi-Fi networks. Download when not charging Allow automatic download when the battery is not charging - Parallel downloads - Episode cache + Parallel Downloads + Episode Cache Light Dark Unlimited @@ -305,11 +305,11 @@ Use default host Expand Notification Always expand the notification to show playback buttons. - Persistent playback controls + Persistent Playback Controls Keep notification and lockscreen controls when playback is paused. Android versions before 4.1 do not support expanded notifications. Add new episodes to the front of the queue. - Enqueue at front. + Enqueue at Front Disabled @@ -332,7 +332,7 @@ Choose a specific file path from the local filesystem. Use an external applications like Dropbox, Google Drive or your favourite file manager to open an OPML file. Many applications like Google Mail, Dropbox, Google Drive and most file managers can open OPML files with AntennaPod. Start import - OPML import + OPML Import ERROR! Reading OPML file An error has occurred while reading the opml document: @@ -344,7 +344,7 @@ OPML export Exporting... Export error - OPML export successful. + OPML Export successful. The .opml file was written to:\u0020 @@ -392,7 +392,7 @@ Selected folder: Create folder - Choose data folder + Choose Data Folder Create new folder with name "%1$s"? Created new folder Cannot write to this folder @@ -402,9 +402,9 @@ The folder you have selected is not empty. Media downloads and other files will be placed directly in this folder. Continue anyway? Choose default folder Pause playback instead of lowering volume when another app wants to play sounds - Pause for interruptions + Pause for Interruptions Resume playback after a phone call completes - Resume after call + Resume after Call Subscribe -- cgit v1.2.3