Search in sources :

Example 1 with PreferenceSwitchDialog

use of de.danoeh.antennapod.fragment.preferences.dialog.PreferenceSwitchDialog in project AntennaPod by AntennaPod.

the class FeedMultiSelectActionHandler method keepUpdatedPrefHandler.

private void keepUpdatedPrefHandler() {
    PreferenceSwitchDialog preferenceSwitchDialog = new PreferenceSwitchDialog(activity, activity.getString(R.string.kept_updated), activity.getString(R.string.keep_updated_summary));
    preferenceSwitchDialog.setOnPreferenceChangedListener(keepUpdated -> {
        saveFeedPreferences(feedPreferences -> {
            feedPreferences.setKeepUpdated(keepUpdated);
        });
    });
    preferenceSwitchDialog.openDialog();
}
Also used : PreferenceSwitchDialog(de.danoeh.antennapod.fragment.preferences.dialog.PreferenceSwitchDialog)

Example 2 with PreferenceSwitchDialog

use of de.danoeh.antennapod.fragment.preferences.dialog.PreferenceSwitchDialog in project AntennaPod by AntennaPod.

the class FeedMultiSelectActionHandler method autoDownloadPrefHandler.

private void autoDownloadPrefHandler() {
    PreferenceSwitchDialog preferenceSwitchDialog = new PreferenceSwitchDialog(activity, activity.getString(R.string.auto_download_settings_label), activity.getString(R.string.auto_download_label));
    preferenceSwitchDialog.setOnPreferenceChangedListener(new PreferenceSwitchDialog.OnPreferenceChangedListener() {

        @Override
        public void preferenceChanged(boolean enabled) {
            saveFeedPreferences(feedPreferences -> feedPreferences.setAutoDownload(enabled));
        }
    });
    preferenceSwitchDialog.openDialog();
}
Also used : RemoveFeedDialog(de.danoeh.antennapod.dialog.RemoveFeedDialog) AlertDialog(androidx.appcompat.app.AlertDialog) PreferenceListDialog(de.danoeh.antennapod.fragment.preferences.dialog.PreferenceListDialog) DecimalFormatSymbols(java.text.DecimalFormatSymbols) R(de.danoeh.antennapod.R) DecimalFormat(java.text.DecimalFormat) ArrayList(java.util.ArrayList) Consumer(androidx.core.util.Consumer) List(java.util.List) MainActivity(de.danoeh.antennapod.activity.MainActivity) FeedPreferences(de.danoeh.antennapod.model.feed.FeedPreferences) PlaybackSpeedFeedSettingDialogBinding(de.danoeh.antennapod.databinding.PlaybackSpeedFeedSettingDialogBinding) DBWriter(de.danoeh.antennapod.core.storage.DBWriter) Locale(java.util.Locale) PluralsRes(androidx.annotation.PluralsRes) PreferenceSwitchDialog(de.danoeh.antennapod.fragment.preferences.dialog.PreferenceSwitchDialog) TagSettingsDialog(de.danoeh.antennapod.dialog.TagSettingsDialog) Snackbar(com.google.android.material.snackbar.Snackbar) Log(android.util.Log) Feed(de.danoeh.antennapod.model.feed.Feed) PreferenceSwitchDialog(de.danoeh.antennapod.fragment.preferences.dialog.PreferenceSwitchDialog)

Aggregations

PreferenceSwitchDialog (de.danoeh.antennapod.fragment.preferences.dialog.PreferenceSwitchDialog)2 Log (android.util.Log)1 PluralsRes (androidx.annotation.PluralsRes)1 AlertDialog (androidx.appcompat.app.AlertDialog)1 Consumer (androidx.core.util.Consumer)1 Snackbar (com.google.android.material.snackbar.Snackbar)1 R (de.danoeh.antennapod.R)1 MainActivity (de.danoeh.antennapod.activity.MainActivity)1 DBWriter (de.danoeh.antennapod.core.storage.DBWriter)1 PlaybackSpeedFeedSettingDialogBinding (de.danoeh.antennapod.databinding.PlaybackSpeedFeedSettingDialogBinding)1 RemoveFeedDialog (de.danoeh.antennapod.dialog.RemoveFeedDialog)1 TagSettingsDialog (de.danoeh.antennapod.dialog.TagSettingsDialog)1 PreferenceListDialog (de.danoeh.antennapod.fragment.preferences.dialog.PreferenceListDialog)1 Feed (de.danoeh.antennapod.model.feed.Feed)1 FeedPreferences (de.danoeh.antennapod.model.feed.FeedPreferences)1 DecimalFormat (java.text.DecimalFormat)1 DecimalFormatSymbols (java.text.DecimalFormatSymbols)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Locale (java.util.Locale)1