From 672c03e41a9663ecb6787047d6176c40b0deed33 Mon Sep 17 00:00:00 2001 From: Tom Hennen Date: Mon, 25 Jan 2016 12:27:42 -0500 Subject: [PATCH] enable/disable controls based on auto-download setting --- .../antennapod/activity/FeedInfoActivity.java | 12 ++++++- app/src/main/res/layout/feedinfo.xml | 31 ++++++++++++------- core/src/main/res/values/strings.xml | 3 +- 3 files changed, 33 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java index 8b46c934d..dedc3d9fd 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java @@ -173,6 +173,7 @@ public class FeedInfoActivity extends ActionBarActivity { public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { feed.getPreferences().setAutoDownload(checked); feed.savePreferences(FeedInfoActivity.this); + updateAutoDownloadSettings(); ApplyToEpisodesDialog dialog = new ApplyToEpisodesDialog(FeedInfoActivity.this, feed, checked); dialog.createNewDialog().show(); @@ -233,7 +234,7 @@ public class FeedInfoActivity extends ActionBarActivity { etxtFilterText.addTextChangedListener(filterTextWatcher); supportInvalidateOptionsMenu(); - + updateAutoDownloadSettings(); } else { Log.e(TAG, "Activity was started with invalid arguments"); } @@ -349,6 +350,15 @@ public class FeedInfoActivity extends ActionBarActivity { } } + private void updateAutoDownloadSettings() { + if (feed != null && feed.getPreferences() != null) { + boolean enabled = feed.getPreferences().getAutoDownload() && UserPreferences.isEnableAutodownload(); + rdoFilterInclude.setEnabled(enabled); + rdoFilterExclude.setEnabled(enabled); + etxtFilterText.setEnabled(enabled); + } + } + private class ApplyToEpisodesDialog extends ConfirmationDialog { private final Feed feed; diff --git a/app/src/main/res/layout/feedinfo.xml b/app/src/main/res/layout/feedinfo.xml index 2e36bf495..e991c243c 100644 --- a/app/src/main/res/layout/feedinfo.xml +++ b/app/src/main/res/layout/feedinfo.xml @@ -150,17 +150,6 @@ android:text="@string/podcast_settings_label" android:layout_marginTop="8dp"/> - - + + + Authentication Change your username and password for this podcast and its episodes. + Auto Download Settings Episode Filter - List of terms used to decide if an episode should be included or excluded from being autodownloaded + List of terms used to decide if an episode should be included or excluded when auto downloading Include Exclude Filter text