diff options
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/FeedSettingsFragment.java | 12 | ||||
-rw-r--r-- | app/src/main/res/xml/feed_settings.xml | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/FeedSettingsFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/FeedSettingsFragment.java index b745313aa..7c1555e66 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/FeedSettingsFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/FeedSettingsFragment.java @@ -52,6 +52,8 @@ public class FeedSettingsFragment extends PreferenceFragmentCompat { public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { addPreferencesFromResource(R.xml.feed_settings); + setupAutoDownloadGlobalPreference(); // To prevent transition animation because of summary update + postponeEnterTransition(); long feedId = getArguments().getLong(EXTRA_FEED_ID); disposable = Maybe.create((MaybeOnSubscribe<Feed>) emitter -> { @@ -219,6 +221,16 @@ public class FeedSettingsFragment extends PreferenceFragmentCompat { }); } + private void setupAutoDownloadGlobalPreference() { + if (!UserPreferences.isEnableAutodownload()) { + SwitchPreference autodl = findPreference("autoDownload"); + autodl.setChecked(false); + autodl.setEnabled(false); + autodl.setSummary(R.string.auto_download_disabled_globally); + findPreference(PREF_EPISODE_FILTER).setEnabled(false); + } + } + private void setupAutoDownloadPreference() { SwitchPreference pref = (SwitchPreference) findPreference("autoDownload"); diff --git a/app/src/main/res/xml/feed_settings.xml b/app/src/main/res/xml/feed_settings.xml index edc608d60..3c0842d30 100644 --- a/app/src/main/res/xml/feed_settings.xml +++ b/app/src/main/res/xml/feed_settings.xml @@ -25,6 +25,7 @@ android:entryValues="@array/spnAutoDeleteValues" android:icon="?attr/content_discard" android:title="@string/auto_delete_label" + android:summary="@string/feed_auto_download_global" android:key="autoDelete"/> <PreferenceCategory android:title="@string/auto_download_settings_label"> |