From 7e2fc2c4a2afd0dca3ea6935a5f1556cb4de6b88 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Mon, 23 Dec 2019 23:38:25 +0100 Subject: Prevent animating feed settings rows --- .../de/danoeh/antennapod/fragment/FeedSettingsFragment.java | 12 ++++++++++++ app/src/main/res/xml/feed_settings.xml | 1 + 2 files changed, 13 insertions(+) (limited to 'app/src') 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) 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"/> -- cgit v1.2.3