diff options
author | Tom Hennen <TomHennen@users.noreply.github.com> | 2015-06-21 12:02:46 -0400 |
---|---|---|
committer | Tom Hennen <TomHennen@users.noreply.github.com> | 2015-06-21 12:02:46 -0400 |
commit | 6b70e304e08b2bf96006890e9d5387512129e43f (patch) | |
tree | fe23ff148140998a63054485f1a08f4611f48e5b /core/src | |
parent | b5fed017d35b395e8b11e66537eb7794fd820445 (diff) | |
parent | 8a9229ede62e9f1efef0e2ac102f1d7e930280b0 (diff) | |
download | AntennaPod-6b70e304e08b2bf96006890e9d5387512129e43f.zip |
Merge pull request #861 from mfietz/feature/120-share-download-url
Share feeds and episodes
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/util/ShareUtils.java | 47 | ||||
-rw-r--r-- | core/src/main/res/values/strings.xml | 120 |
2 files changed, 99 insertions, 68 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 85f32ed50..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 @@ -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,49 @@ public class ShareUtils { private ShareUtils() {} - public static void shareLink(Context context, String link) { + public static void shareLink(Context context, 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); - context.startActivity(Intent.createChooser(i, "Share URL")); + i.putExtra(Intent.EXTRA_TEXT, text); + context.startActivity(Intent.createChooser(i, context.getString(R.string.share_url_label))); } - - public static void shareFeedItemLink(Context context, FeedItem item) { - shareLink(context, item.getLink()); + + public static void shareFeedlink(Context context, Feed feed) { + shareLink(context, feed.getLink()); } public static void shareFeedDownloadLink(Context context, Feed feed) { shareLink(context, 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 text; + 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; + if(withPosition) { + int pos = item.getMedia().getPosition(); + text = item.getMedia().getDownload_url() + " [" + Converter.getDurationStringLong(pos) + "]"; + } else { + text = item.getMedia().getDownload_url(); + } + shareLink(context, text); } } diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 3cedfb8e5..ac9255ac9 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -7,27 +7,27 @@ <!-- Activitiy and fragment titles --> <string name="app_name">AntennaPod</string> <string name="feeds_label">Feeds</string> - <string name="add_feed_label">Add podcast</string> + <string name="add_feed_label">Add Podcast</string> <string name="podcasts_label">PODCASTS</string> <string name="episodes_label">EPISODES</string> - <string name="new_episodes_label">New episodes</string> - <string name="all_episodes_label">All episodes</string> + <string name="new_episodes_label">New Episodes</string> + <string name="all_episodes_label">All Episodes</string> <string name="new_label">New</string> - <string name="waiting_list_label">Waiting list</string> + <string name="waiting_list_label">Waiting List</string> <string name="settings_label">Settings</string> - <string name="add_new_feed_label">Add podcast</string> + <string name="add_new_feed_label">Add Podcast</string> <string name="downloads_label">Downloads</string> <string name="downloads_running_label">Running</string> <string name="downloads_completed_label">Completed</string> <string name="downloads_log_label">Log</string> <string name="cancel_download_label">Cancel Download</string> - <string name="playback_history_label">Playback history</string> + <string name="playback_history_label">Playback History</string> <string name="gpodnet_main_label">gpodder.net</string> - <string name="gpodnet_auth_label">gpodder.net login</string> + <string name="gpodnet_auth_label">gpodder.net Login</string> <!-- New episodes fragment --> <string name="recently_published_episodes_label">Recently published</string> - <string name="episode_filter_label">Show only new episodes</string> + <string name="episode_filter_label">Show only new Episodes</string> <!-- Main activity --> <string name="drawer_open">Open menu</string> @@ -35,14 +35,14 @@ <string name="drawer_preferences">Drawer Preferences</string> <!-- Webview actions --> - <string name="open_in_browser_label">Open in browser</string> + <string name="open_in_browser_label">Open in Browser</string> <string name="copy_url_label">Copy URL</string> <string name="share_url_label">Share URL</string> - <string name="copied_url_msg">Copied URL to clipboard.</string> - <string name="go_to_position_label">Go to this position</string> + <string name="copied_url_msg">Copied URL to Clipboard</string> + <string name="go_to_position_label">Go to this Position</string> <!-- Playback history --> - <string name="clear_history_label">Clear history</string> + <string name="clear_history_label">Clear History</string> <!-- Other --> <string name="confirm_label">Confirm</string> @@ -59,7 +59,7 @@ <string name="chapters_label">Chapters</string> <string name="shownotes_label">Shownotes</string> <string name="description_label">Description</string> - <string name="most_recent_prefix">Most Recent Episode:\u0020</string> + <string name="most_recent_prefix">Most recent episode:\u0020</string> <string name="episodes_suffix">\u0020episodes</string> <string name="length_prefix">Length:\u0020</string> <string name="size_prefix">Size:\u0020</string> @@ -75,23 +75,27 @@ <string name="feedurl_label">Feed URL</string> <string name="etxtFeedurlHint">www.example.com/feed</string> <string name="txtvfeedurl_label">Add Podcast by URL</string> - <string name="podcastdirectories_label">Find podcast in directory</string> + <string name="podcastdirectories_label">Find Podcast in Directory</string> <string name="podcastdirectories_descr">You can search for new podcasts by name, category or popularity in the gpodder.net directory, or search the iTunes store.</string> <string name="browse_gpoddernet_label">Browse gpodder.net</string> <!-- Actions on feeds --> <string name="mark_all_read_label">Mark all as played</string> - <string name="mark_all_read_msg">Marked all episodes as played</string> + <string name="mark_all_read_msg">Marked all Episodes as played</string> <string name="mark_all_read_confirmation_msg">Please confirm that you want to mark all episodes as being played.</string> <string name="mark_all_read_feed_confirmation_msg">Please confirm that you want to mark all episodes in this feed as being played.</string> <string name="show_info_label">Show information</string> - <string name="remove_feed_label">Remove podcast</string> - <string name="share_link_label">Share website link</string> - <string name="share_source_label">Share feed link</string> + <string name="remove_feed_label">Remove Podcast</string> + <string name="share_label">Share...</string> + <string name="share_link_label">Share Link</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 URL</string> + <string name="share_item_url_with_position_label">Share Episode URL with Position</string> <string name="feed_delete_confirmation_msg">Please confirm that you want to delete this feed and ALL episodes of this feed that you have downloaded.</string> - <string name="feed_remover_msg">Removing feed</string> - <string name="load_complete_feed">Refresh complete feed</string> - <string name="hide_episodes_title">Hide episodes</string> + <string name="feed_remover_msg">Removing Feed</string> + <string name="load_complete_feed">Refresh complete Feed</string> + <string name="hide_episodes_title">Hide Episodes</string> <string name="hide_unplayed_episodes_label">Unplayed</string> <string name="hide_paused_episodes_label">Paused</string> <string name="hide_played_episodes_label">Played</string> @@ -100,7 +104,7 @@ <string name="hide_downloaded_episodes_label">Downloaded</string> <string name="hide_not_downloaded_episodes_label">Not downloaded</string> <string name="filtered_label">Filtered</string> - <string name="refresh_failed_msg">{fa-exclamation-circle} Last refresh failed</string> + <string name="refresh_failed_msg">{fa-exclamation-circle} Last Refresh failed</string> <!-- actions on feeditems --> <string name="download_label">Download</string> @@ -109,7 +113,7 @@ <string name="stop_label">Stop</string> <string name="stream_label">Stream</string> <string name="remove_label">Remove</string> - <string name="remove_episode_lable">Remove episode</string> + <string name="remove_episode_lable">Remove Episode</string> <string name="mark_read_label">Mark as played</string> <string name="mark_unread_label">Mark as unplayed</string> <string name="marked_as_read_label">Marked as played</string> @@ -121,39 +125,39 @@ <string name="enqueue_all_new">Enqueue all</string> <string name="download_all">Download all</string> <string name="skip_episode_label">Skip episode</string> - <string name="activate_auto_download">Activate auto download</string> - <string name="deactivate_auto_download">Deactivate auto download</string> - <string name="reset_position">Reset playback position</string> + <string name="activate_auto_download">Activate Auto Download</string> + <string name="deactivate_auto_download">Deactivate Auto Download</string> + <string name="reset_position">Reset Playback Position</string> <!-- Download messages and labels --> <string name="download_successful">successful</string> <string name="download_failed">failed</string> <string name="download_pending">Download pending</string> <string name="download_running">Download running</string> - <string name="download_error_device_not_found">Storage device not found</string> - <string name="download_error_insufficient_space">Insufficient space</string> - <string name="download_error_file_error">File error</string> + <string name="download_error_device_not_found">Storage Device not found</string> + <string name="download_error_insufficient_space">Insufficient Space</string> + <string name="download_error_file_error">File Error</string> <string name="download_error_http_data_error">HTTP Data Error</string> <string name="download_error_error_unknown">Unknown Error</string> <string name="download_error_parser_exception">Parser Exception</string> - <string name="download_error_unsupported_type">Unsupported Feed type</string> - <string name="download_error_connection_error">Connection error</string> - <string name="download_error_unknown_host">Unknown host</string> - <string name="download_error_unauthorized">Authentication error</string> + <string name="download_error_unsupported_type">Unsupported Feed Type</string> + <string name="download_error_connection_error">Connection Error</string> + <string name="download_error_unknown_host">Unknown Host</string> + <string name="download_error_unauthorized">Authentication Error</string> <string name="cancel_all_downloads_label">Cancel all downloads</string> <string name="download_canceled_msg">Download canceled</string> <string name="download_canceled_autodownload_enabled_msg">Download canceled\nDisabled <i>Auto Download</i> for this item</string> <string name="download_report_title">Downloads completed with error(s)</string> - <string name="download_report_content_title">Download report</string> + <string name="download_report_content_title">Download Report</string> <string name="download_error_malformed_url">Malformed URL</string> <string name="download_error_io_error">IO Error</string> - <string name="download_error_request_error">Request error</string> - <string name="download_error_db_access">Database access error</string> + <string name="download_error_request_error">Request Error</string> + <string name="download_error_db_access">Database Access Error</string> <string name="downloads_left">\u0020Downloads left</string> <string name="downloads_processing">Processing downloads</string> <string name="download_notification_title">Downloading podcast data</string> <string name="download_report_content">%1$d downloads succeeded, %2$d failed</string> - <string name="download_log_title_unknown">Unknown title</string> + <string name="download_log_title_unknown">Unknown Title</string> <string name="download_type_feed">Feed</string> <string name="download_type_media">Media file</string> <string name="download_type_image">Image</string> @@ -181,9 +185,9 @@ <string name="unknown_media_key">AntennaPod - Unknown media key: %1$d</string> <!-- Queue operations --> - <string name="lock_queue">Lock queue</string> - <string name="unlock_queue">Unlock queue</string> - <string name="clear_queue_label">Clear queue</string> + <string name="lock_queue">Lock Queue</string> + <string name="unlock_queue">Unlock Queue</string> + <string name="clear_queue_label">Clear Queue</string> <string name="undo">Undo</string> <string name="removed_from_queue">Item removed</string> <string name="move_to_top_label">Move to top</string> @@ -249,38 +253,38 @@ <string name="pref_smart_mark_as_played_title">Smart mark as played</string> <string name="playback_pref">Playback</string> <string name="network_pref">Network</string> - <string name="pref_autoUpdateIntervall_title">Update interval</string> + <string name="pref_autoUpdateIntervall_title">Update Interval</string> <string name="pref_autoUpdateIntervall_sum">Specify an interval in which the feeds are refreshed automatically or disable it</string> <string name="pref_downloadMediaOnWifiOnly_sum">Download media files only over WiFi</string> - <string name="pref_followQueue_title">Continuous playback</string> + <string name="pref_followQueue_title">Continuous Playback</string> <string name="pref_downloadMediaOnWifiOnly_title">WiFi media download</string> - <string name="pref_pauseOnHeadsetDisconnect_title">Headphones disconnect</string> - <string name="pref_unpauseOnHeadsetReconnect_title">Headphones reconnect</string> - <string name="pref_mobileUpdate_title">Mobile updates</string> + <string name="pref_pauseOnHeadsetDisconnect_title">Headphones Disconnect</string> + <string name="pref_unpauseOnHeadsetReconnect_title">Headphones Reconnect</string> + <string name="pref_mobileUpdate_title">Mobile Updates</string> <string name="pref_mobileUpdate_sum">Allow updates over the mobile data connection</string> <string name="refreshing_label">Refreshing</string> <string name="flattr_settings_label">Flattr settings</string> <string name="pref_flattr_auth_title">Flattr sign-in</string> <string name="pref_flattr_auth_sum">Sign in to your flattr account to flattr things directly from the app.</string> - <string name="pref_flattr_this_app_title">Flattr this app</string> + <string name="pref_flattr_this_app_title">Flattr this App</string> <string name="pref_flattr_this_app_sum">Support the development of AntennaPod by flattring it. Thanks!</string> <string name="pref_revokeAccess_title">Revoke access</string> <string name="pref_revokeAccess_sum">Revoke the access permission to your flattr account for this app.</string> <string name="pref_auto_flattr_title">Automatic Flattr</string> <string name="pref_auto_flattr_sum">Configure automatic flattring</string> <string name="user_interface_label">User Interface</string> - <string name="pref_set_theme_title">Select theme</string> - <string name="pref_nav_drawer_items_title">Change navigation drawer</string> + <string name="pref_set_theme_title">Select Theme</string> + <string name="pref_nav_drawer_items_title">Change Navigation Drawer</string> <string name="pref_nav_drawer_items_sum">Change which items appear in the navigation drawer.</string> <string name="pref_set_theme_sum">Change the appearance of AntennaPod.</string> - <string name="pref_automatic_download_title">Automatic download</string> + <string name="pref_automatic_download_title">Automatic Download</string> <string name="pref_automatic_download_sum">Configure the automatic download of episodes.</string> <string name="pref_autodl_wifi_filter_title">Enable Wi-Fi filter</string> <string name="pref_autodl_wifi_filter_sum">Allow automatic download only for selected Wi-Fi networks.</string> <string name="pref_automatic_download_on_battery_title">Download when not charging</string> <string name="pref_automatic_download_on_battery_sum">Allow automatic download when the battery is not charging</string> - <string name="pref_parallel_downloads_title">Parallel downloads</string> - <string name="pref_episode_cache_title">Episode cache</string> + <string name="pref_parallel_downloads_title">Parallel Downloads</string> + <string name="pref_episode_cache_title">Episode Cache</string> <string name="pref_theme_title_light">Light</string> <string name="pref_theme_title_dark">Dark</string> <string name="pref_episode_cache_unlimited">Unlimited</string> @@ -301,11 +305,11 @@ <string name="pref_gpodnet_sethostname_use_default_host">Use default host</string> <string name="pref_expandNotify_title">Expand Notification</string> <string name="pref_expandNotify_sum">Always expand the notification to show playback buttons.</string> - <string name="pref_persistNotify_title">Persistent playback controls</string> + <string name="pref_persistNotify_title">Persistent Playback Controls</string> <string name="pref_persistNotify_sum">Keep notification and lockscreen controls when playback is paused.</string> <string name="pref_expand_notify_unsupport_toast">Android versions before 4.1 do not support expanded notifications.</string> <string name="pref_queueAddToFront_sum">Add new episodes to the front of the queue.</string> - <string name="pref_queueAddToFront_title">Enqueue at front.</string> + <string name="pref_queueAddToFront_title">Enqueue at Front</string> <string name="pref_smart_mark_as_played_disabled">Disabled</string> @@ -328,7 +332,7 @@ <string name="opml_import_explanation_1">Choose a specific file path from the local filesystem.</string> <string name="opml_import_explanation_2">Use an external applications like Dropbox, Google Drive or your favourite file manager to open an OPML file.</string> <string name="opml_import_explanation_3">Many applications like Google Mail, Dropbox, Google Drive and most file managers can <i>open</i> OPML files <i>with</i> AntennaPod.</string> <string name="start_import_label">Start import</string> - <string name="opml_import_label">OPML import</string> + <string name="opml_import_label">OPML Import</string> <string name="opml_directory_error">ERROR!</string> <string name="reading_opml_label">Reading OPML file</string> <string name="opml_reader_error">An error has occurred while reading the opml document:</string> @@ -340,7 +344,7 @@ <string name="opml_export_label">OPML export</string> <string name="exporting_label">Exporting...</string> <string name="export_error_label">Export error</string> - <string name="opml_export_success_title">OPML export successful.</string> + <string name="opml_export_success_title">OPML Export successful.</string> <string name="opml_export_success_sum">The .opml file was written to:\u0020</string> <!-- Sleep timer --> @@ -388,7 +392,7 @@ <!-- Directory chooser --> <string name="selected_folder_label">Selected folder:</string> <string name="create_folder_label">Create folder</string> - <string name="choose_data_directory">Choose data folder</string> + <string name="choose_data_directory">Choose Data Folder</string> <string name="create_folder_msg">Create new folder with name "%1$s"?</string> <string name="create_folder_success">Created new folder</string> <string name="create_folder_error_no_write_access">Cannot write to this folder</string> @@ -398,9 +402,9 @@ <string name="folder_not_empty_dialog_msg">The folder you have selected is not empty. Media downloads and other files will be placed directly in this folder. Continue anyway?</string> <string name="set_to_default_folder">Choose default folder</string> <string name="pref_pausePlaybackForFocusLoss_sum">Pause playback instead of lowering volume when another app wants to play sounds</string> - <string name="pref_pausePlaybackForFocusLoss_title">Pause for interruptions</string> + <string name="pref_pausePlaybackForFocusLoss_title">Pause for Interruptions</string> <string name="pref_resumeAfterCall_sum">Resume playback after a phone call completes</string> - <string name="pref_resumeAfterCall_title">Resume after call</string> + <string name="pref_resumeAfterCall_title">Resume after Call</string> <!-- Online feed view --> <string name="subscribe_label">Subscribe</string> |