diff options
author | ByteHamster <info@bytehamster.com> | 2019-12-23 23:38:25 +0100 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2019-12-23 23:38:25 +0100 |
commit | 7e2fc2c4a2afd0dca3ea6935a5f1556cb4de6b88 (patch) | |
tree | 86e904cf02014b94537d4d29a992090d9153c7b1 /app/src | |
parent | 19890afc663d067f70e0286eeaa73cb8cb7acbad (diff) | |
download | AntennaPod-7e2fc2c4a2afd0dca3ea6935a5f1556cb4de6b88.zip |
Prevent animating feed settings rows
Diffstat (limited to 'app/src')
-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"> |