diff options
author | Martin Fietz <marf@hadiko-99-4.hadiko.uni-karlsruhe.de> | 2015-05-04 23:47:34 +0200 |
---|---|---|
committer | Martin Fietz <marf@hadiko-99-4.hadiko.uni-karlsruhe.de> | 2015-05-09 00:03:41 +0200 |
commit | c8259daaeee9870bc806c5d8b4bed669e68d061c (patch) | |
tree | 427479a7d9a0280d234dec47e29d4c715fc02b26 /app/src/main/java/de/danoeh/antennapod/adapter | |
parent | 11a66f451ab76b1ef5c45f12c6ed7100040b9084 (diff) | |
download | AntennaPod-c8259daaeee9870bc806c5d8b4bed669e68d061c.zip |
Cancel auto download
Diffstat (limited to 'app/src/main/java/de/danoeh/antennapod/adapter')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/adapter/DefaultActionButtonCallback.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/DefaultActionButtonCallback.java b/app/src/main/java/de/danoeh/antennapod/adapter/DefaultActionButtonCallback.java index 6df18e759..e39b9e684 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/DefaultActionButtonCallback.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/DefaultActionButtonCallback.java @@ -12,9 +12,11 @@ import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.dialog.DownloadRequestErrorDialogCreator; import de.danoeh.antennapod.core.feed.FeedItem; import de.danoeh.antennapod.core.feed.FeedMedia; + +import de.danoeh.antennapod.core.preferences.UserPreferences; +import de.danoeh.antennapod.core.service.playback.PlaybackService; import de.danoeh.antennapod.core.gpoddernet.model.GpodnetEpisodeAction; import de.danoeh.antennapod.core.preferences.GpodnetPreferences; -import de.danoeh.antennapod.core.service.playback.PlaybackService; import de.danoeh.antennapod.core.storage.DBReader; import de.danoeh.antennapod.core.storage.DBTasks; import de.danoeh.antennapod.core.storage.DBWriter; @@ -75,7 +77,12 @@ public class DefaultActionButtonCallback implements ActionButtonCallback { } } else if (isDownloading) { DownloadRequester.getInstance().cancelDownload(context, media); - Toast.makeText(context, R.string.download_cancelled_msg, Toast.LENGTH_SHORT).show(); + if(UserPreferences.isEnableAutodownload()) { + DBWriter.setFeedItemAutoDownload(context, media.getItem(), false); + Toast.makeText(context, R.string.download_cancelled_autodownload_enabled_msg, Toast.LENGTH_LONG).show(); + } else { + Toast.makeText(context, R.string.download_cancelled_msg, Toast.LENGTH_LONG).show(); + } } else { // media is downloaded if (item.hasMedia() && item.getMedia().isCurrentlyPlaying()) { context.sendBroadcast(new Intent(PlaybackService.ACTION_PAUSE_PLAY_CURRENT_EPISODE)); |