summaryrefslogtreecommitdiff
path: root/src/de/danoeh/antennapod/preferences/UserPreferences.java
diff options
context:
space:
mode:
authorTom Hennen <tom.hennen@gmail.com>2013-08-14 12:26:03 -0400
committerTom Hennen <tom.hennen@gmail.com>2013-08-14 12:26:03 -0400
commit3f8e6c26a348562799762ae1289195e557a02eaa (patch)
tree6bcf7773d48b618b6d871045581b90fa72139d76 /src/de/danoeh/antennapod/preferences/UserPreferences.java
parent6b69f7fe28b0996d4cbaa97bf274ebc0d3c7cf34 (diff)
downloadAntennaPod-3f8e6c26a348562799762ae1289195e557a02eaa.zip
Adds an option to pause audio while audio focus is lost. This is helpful when using navigation apps (for example) so that you can hear what the navigation app says and you don't miss whatever was being said on your podcast. Without this setting checked they may wind up talking over each other, which can be confusing.
Diffstat (limited to 'src/de/danoeh/antennapod/preferences/UserPreferences.java')
-rw-r--r--src/de/danoeh/antennapod/preferences/UserPreferences.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/de/danoeh/antennapod/preferences/UserPreferences.java b/src/de/danoeh/antennapod/preferences/UserPreferences.java
index f2f35f41d..662db9b17 100644
--- a/src/de/danoeh/antennapod/preferences/UserPreferences.java
+++ b/src/de/danoeh/antennapod/preferences/UserPreferences.java
@@ -41,6 +41,7 @@ public class UserPreferences implements
public static final String PREF_ENABLE_AUTODL_WIFI_FILTER = "prefEnableAutoDownloadWifiFilter";
private static final String PREF_AUTODL_SELECTED_NETWORKS = "prefAutodownloadSelectedNetworks";
public static final String PREF_EPISODE_CACHE_SIZE = "prefEpisodeCacheSize";
+ public static final String PREF_PAUSE_PLAYBACK_FOR_NOTIFICATIONS = "prefPauseForNotifications";
private static int EPISODE_CACHE_SIZE_UNLIMITED = -1;
@@ -60,6 +61,7 @@ public class UserPreferences implements
private boolean enableAutodownloadWifiFilter;
private String[] autodownloadSelectedNetworks;
private int episodeCacheSize;
+ private boolean pauseForNotifications;
private UserPreferences(Context context) {
this.context = context;
@@ -108,6 +110,7 @@ public class UserPreferences implements
episodeCacheSize = readEpisodeCacheSize(sp.getString(
PREF_EPISODE_CACHE_SIZE, "20"));
enableAutodownload = sp.getBoolean(PREF_ENABLE_AUTODL, false);
+ pauseForNotifications = sp.getBoolean(PREF_PAUSE_PLAYBACK_FOR_NOTIFICATIONS, false);
}
private int readThemeValue(String valueFromPrefs) {
@@ -210,6 +213,11 @@ public class UserPreferences implements
instanceAvailable();
return instance.enableAutodownload;
}
+
+ public static boolean shouldPauseForNotifications() {
+ instanceAvailable();
+ return instance.pauseForNotifications;
+ }
@Override
public void onSharedPreferenceChanged(SharedPreferences sp, String key) {
@@ -250,6 +258,8 @@ public class UserPreferences implements
PREF_EPISODE_CACHE_SIZE, "20"));
} else if (key.equals(PREF_ENABLE_AUTODL)) {
enableAutodownload = sp.getBoolean(PREF_ENABLE_AUTODL, false);
+ } else if (key.equals(PREF_PAUSE_PLAYBACK_FOR_NOTIFICATIONS)) {
+ pauseForNotifications = sp.getBoolean(PREF_PAUSE_PLAYBACK_FOR_NOTIFICATIONS, false);
}
}