mirror of
https://github.com/AntennaPod/AntennaPod.git
synced 2026-02-04 14:25:49 +00:00
Clarify that new episodes action cannot be changed when autodownload is enabled (#8227)
This commit is contained in:
committed by
GitHub
parent
6695d5fadd
commit
780ceaa462
@ -22,6 +22,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||||
import de.danoeh.antennapod.R;
|
import de.danoeh.antennapod.R;
|
||||||
import de.danoeh.antennapod.databinding.PlaybackSpeedFeedSettingDialogBinding;
|
import de.danoeh.antennapod.databinding.PlaybackSpeedFeedSettingDialogBinding;
|
||||||
|
import de.danoeh.antennapod.event.MessageEvent;
|
||||||
import de.danoeh.antennapod.event.settings.SkipIntroEndingChangedEvent;
|
import de.danoeh.antennapod.event.settings.SkipIntroEndingChangedEvent;
|
||||||
import de.danoeh.antennapod.event.settings.SpeedPresetChangedEvent;
|
import de.danoeh.antennapod.event.settings.SpeedPresetChangedEvent;
|
||||||
import de.danoeh.antennapod.event.settings.VolumeAdaptionChangedEvent;
|
import de.danoeh.antennapod.event.settings.VolumeAdaptionChangedEvent;
|
||||||
@ -213,6 +214,14 @@ public class FeedSettingsPreferenceFragment extends PreferenceFragmentCompat {
|
|||||||
EventBus.getDefault().post(new VolumeAdaptionChangedEvent(newSetting, feed.getId()));
|
EventBus.getDefault().post(new VolumeAdaptionChangedEvent(newSetting, feed.getId()));
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
findPreference(PREF_NEW_EPISODES_ACTION).setOnPreferenceClickListener(preference -> {
|
||||||
|
boolean isAutoDownload = feed.getPreferences().isAutoDownload(UserPreferences.isEnableAutodownloadGlobal());
|
||||||
|
if (isAutoDownload && !feed.isLocalFeed()) {
|
||||||
|
EventBus.getDefault().post(new MessageEvent(getString(R.string.feed_new_episodes_action_snackbar)));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
findPreference(PREF_NEW_EPISODES_ACTION).setOnPreferenceChangeListener((preference, newValue) -> {
|
findPreference(PREF_NEW_EPISODES_ACTION).setOnPreferenceChangeListener((preference, newValue) -> {
|
||||||
int code = Integer.parseInt((String) newValue);
|
int code = Integer.parseInt((String) newValue);
|
||||||
feedPreferences.setNewEpisodesAction(FeedPreferences.NewEpisodesAction.fromCode(code));
|
feedPreferences.setNewEpisodesAction(FeedPreferences.NewEpisodesAction.fromCode(code));
|
||||||
@ -284,7 +293,6 @@ public class FeedSettingsPreferenceFragment extends PreferenceFragmentCompat {
|
|||||||
ListPreference newEpisodesAction = findPreference(PREF_NEW_EPISODES_ACTION);
|
ListPreference newEpisodesAction = findPreference(PREF_NEW_EPISODES_ACTION);
|
||||||
boolean isAutoDownload = feed.getPreferences().isAutoDownload(UserPreferences.isEnableAutodownloadGlobal());
|
boolean isAutoDownload = feed.getPreferences().isAutoDownload(UserPreferences.isEnableAutodownloadGlobal());
|
||||||
if (isAutoDownload && !feed.isLocalFeed()) {
|
if (isAutoDownload && !feed.isLocalFeed()) {
|
||||||
newEpisodesAction.setEnabled(false);
|
|
||||||
newEpisodesAction.setSummary(R.string.feed_new_episodes_action_summary_autodownload);
|
newEpisodesAction.setSummary(R.string.feed_new_episodes_action_summary_autodownload);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -159,6 +159,7 @@
|
|||||||
<string name="feed_new_episodes_action_add_to_queue">Add to queue</string>
|
<string name="feed_new_episodes_action_add_to_queue">Add to queue</string>
|
||||||
<string name="feed_new_episodes_action_nothing">Nothing</string>
|
<string name="feed_new_episodes_action_nothing">Nothing</string>
|
||||||
<string name="feed_new_episodes_action_summary_autodownload">Automatic download enabled. Episodes are added to the inbox and then moved to the queue once downloaded.</string>
|
<string name="feed_new_episodes_action_summary_autodownload">Automatic download enabled. Episodes are added to the inbox and then moved to the queue once downloaded.</string>
|
||||||
|
<string name="feed_new_episodes_action_snackbar">Cannot be changed when automatic download is enabled.</string>
|
||||||
<string name="episode_cleanup_never">Never</string>
|
<string name="episode_cleanup_never">Never</string>
|
||||||
<string name="episode_cleanup_except_favorite_removal">When not favorited</string>
|
<string name="episode_cleanup_except_favorite_removal">When not favorited</string>
|
||||||
<string name="episode_cleanup_queue_removal">When not in queue</string>
|
<string name="episode_cleanup_queue_removal">When not in queue</string>
|
||||||
|
|||||||
@ -17,6 +17,9 @@ public class MaterialListPreference extends ListPreference {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onClick() {
|
protected void onClick() {
|
||||||
|
if (getOnPreferenceClickListener() != null && getOnPreferenceClickListener().onPreferenceClick(this)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(getContext());
|
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(getContext());
|
||||||
builder.setTitle(getTitle());
|
builder.setTitle(getTitle());
|
||||||
builder.setIcon(getDialogIcon());
|
builder.setIcon(getDialogIcon());
|
||||||
|
|||||||
Reference in New Issue
Block a user