diff options
author | Tom Hennen <tom.hennen@gmail.com> | 2015-01-05 21:23:21 -0500 |
---|---|---|
committer | Tom Hennen <tom.hennen@gmail.com> | 2015-01-05 21:23:21 -0500 |
commit | 1b9c96bc7664adeb12ffd0267c76a4667b25311f (patch) | |
tree | 6a105f8ab1a7468f61f7d35d57de45fb3043a4bb /app | |
parent | 9ece3a7db4949455cbaf0127e3eea3c4c739f9b1 (diff) | |
download | AntennaPod-1b9c96bc7664adeb12ffd0267c76a4667b25311f.zip |
Add ability to only do autodl when charging.
Defaults to allow autodl on battery to preserve existing behavior.
Might be a good idea to add a receiver for the intent similar to
ConnectivityActionReceiver as this will allow us to start/stop
downloads as needed.
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java | 3 | ||||
-rw-r--r-- | app/src/main/res/xml/preferences.xml | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java index cbd5c0f29..ffac05321 100644 --- a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java +++ b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java @@ -195,6 +195,7 @@ public class PreferenceController { if (newValue instanceof Boolean) { ui.findPreference(UserPreferences.PREF_ENABLE_AUTODL_WIFI_FILTER).setEnabled((Boolean) newValue); setSelectedNetworksEnabled((Boolean) newValue && UserPreferences.isEnableAutodownloadWifiFilter()); + ui.findPreference(UserPreferences.PREF_ENABLE_AUTODL_ON_BATTERY).setEnabled((Boolean) newValue); } return true; } @@ -376,6 +377,8 @@ public class PreferenceController { setSelectedNetworksEnabled(UserPreferences.isEnableAutodownload() && UserPreferences.isEnableAutodownloadWifiFilter()); + ui.findPreference(UserPreferences.PREF_ENABLE_AUTODL_ON_BATTERY) + .setEnabled(UserPreferences.isEnableAutodownload()); } private void setEpisodeCacheSizeText(int cacheSize) { diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index 5f4a7583d..afb8bb135 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -93,6 +93,11 @@ android:title="@string/pref_automatic_download_title" android:defaultValue="false"/> <CheckBoxPreference + android:key="prefEnableAutoDownloadOnBattery" + android:title="@string/pref_automatic_download_on_battery_title" + android:summary="@string/pref_automatic_download_on_battery_sum" + android:defaultValue="true"/> + <CheckBoxPreference android:key="prefEnableAutoDownloadWifiFilter" android:title="@string/pref_autodl_wifi_filter_title" android:summary="@string/pref_autodl_wifi_filter_sum"/> |