diff options
author | ByteHamster <info@bytehamster.com> | 2022-04-25 22:45:47 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2022-04-26 17:57:42 +0200 |
commit | 069a2ca329a342ad0559a48719f49264d2610f00 (patch) | |
tree | 59cc8327dec62ddfd105d1ad2fdb59dcba12736e /app/src/main | |
parent | 20363ee41c814b14b16999505fa850a0943346dd (diff) | |
download | AntennaPod-069a2ca329a342ad0559a48719f49264d2610f00.zip |
Decouple preferences
Diffstat (limited to 'app/src/main')
4 files changed, 8 insertions, 3 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java index 3f7a5db68..b23e22c9f 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java @@ -231,6 +231,7 @@ public class MainActivity extends CastEnabledActivity { // for backward compatibility, we only change defaults for fresh installs UserPreferences.setUpdateInterval(12); + AutoUpdateManager.restartUpdateAlarm(this); SharedPreferences.Editor edit = prefs.edit(); edit.putBoolean(PREF_IS_FIRST_LAUNCH, false); diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/FeedRefreshIntervalDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/FeedRefreshIntervalDialog.java index 7e42302d1..f97940f8b 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/FeedRefreshIntervalDialog.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/FeedRefreshIntervalDialog.java @@ -10,6 +10,7 @@ import android.widget.ArrayAdapter; import androidx.appcompat.app.AlertDialog; import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.preferences.UserPreferences; +import de.danoeh.antennapod.core.util.download.AutoUpdateManager; import de.danoeh.antennapod.databinding.FeedRefreshDialogBinding; import org.apache.commons.lang3.ArrayUtils; @@ -70,6 +71,7 @@ public class FeedRefreshIntervalDialog { builder.setPositiveButton(R.string.confirm_label, (dialog, which) -> { if (viewBinding.intervalRadioButton.isChecked()) { UserPreferences.setUpdateInterval(INTERVAL_VALUES_HOURS[viewBinding.spinner.getSelectedItemPosition()]); + AutoUpdateManager.restartUpdateAlarm(context); } else if (viewBinding.timeRadioButton.isChecked()) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { UserPreferences.setUpdateTimeOfDay(viewBinding.timePicker.getHour(), @@ -78,8 +80,10 @@ public class FeedRefreshIntervalDialog { UserPreferences.setUpdateTimeOfDay(viewBinding.timePicker.getCurrentHour(), viewBinding.timePicker.getCurrentMinute()); } + AutoUpdateManager.restartUpdateAlarm(context); } else if (viewBinding.disableRadioButton.isChecked()) { - UserPreferences.disableAutoUpdate(context); + UserPreferences.disableAutoUpdate(); + AutoUpdateManager.disableAutoUpdate(context); } else { throw new IllegalStateException("Unexpected error."); } diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java index 2c3c44b1d..b24a26602 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java @@ -29,7 +29,7 @@ import java.util.concurrent.TimeUnit; import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.core.service.download.AntennapodHttpClient; -import de.danoeh.antennapod.core.service.download.ProxyConfig; +import de.danoeh.antennapod.model.download.ProxyConfig; import io.reactivex.Completable; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.disposables.Disposable; diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/SubscriptionsFilterDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/SubscriptionsFilterDialog.java index 9e524188f..a468794cb 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/SubscriptionsFilterDialog.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/SubscriptionsFilterDialog.java @@ -17,7 +17,7 @@ import java.util.Set; import de.danoeh.antennapod.R; import de.danoeh.antennapod.event.UnreadItemsUpdateEvent; -import de.danoeh.antennapod.core.feed.SubscriptionsFilter; +import de.danoeh.antennapod.model.feed.SubscriptionsFilter; import de.danoeh.antennapod.core.feed.SubscriptionsFilterGroup; import de.danoeh.antennapod.core.preferences.UserPreferences; import de.danoeh.antennapod.ui.common.RecursiveRadioGroup; |