summaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
authormueller-ma <mueller-ma@users.noreply.github.com>2024-02-25 15:02:44 +0100
committerGitHub <noreply@github.com>2024-02-25 15:02:44 +0100
commit9cfbae183cd1b5e1bb1fed68125ab064d5be7c55 (patch)
treefe6dd49c414e8f8e7507a4a879ce8312f00a02fe /app/src
parent82c93bf7ee3d91395533068fdfe640dfa53113fe (diff)
downloadAntennaPod-9cfbae183cd1b5e1bb1fed68125ab064d5be7c55.zip
Toggle sleep timer from notification (#6913)
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/preferences/UserInterfacePreferencesFragment.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/UserInterfacePreferencesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/UserInterfacePreferencesFragment.java
index 0f3320e98..2edf8cb68 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/UserInterfacePreferencesFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/UserInterfacePreferencesFragment.java
@@ -6,12 +6,19 @@ import android.os.Build;
import android.os.Bundle;
import android.widget.Button;
import android.widget.ListView;
+
import androidx.appcompat.app.AlertDialog;
import androidx.core.app.ActivityCompat;
import androidx.preference.Preference;
import androidx.preference.PreferenceFragmentCompat;
+
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.snackbar.Snackbar;
+
+import org.greenrobot.eventbus.EventBus;
+
+import java.util.List;
+
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.activity.PreferenceActivity;
import de.danoeh.antennapod.dialog.DrawerPreferencesDialog;
@@ -20,9 +27,6 @@ import de.danoeh.antennapod.dialog.SubscriptionsFilterDialog;
import de.danoeh.antennapod.event.PlayerStatusEvent;
import de.danoeh.antennapod.event.UnreadItemsUpdateEvent;
import de.danoeh.antennapod.storage.preferences.UserPreferences;
-import org.greenrobot.eventbus.EventBus;
-
-import java.util.List;
public class UserInterfacePreferencesFragment extends PreferenceFragmentCompat {
private static final String PREF_SWIPE = "prefSwipe";
@@ -100,7 +104,12 @@ public class UserInterfacePreferencesFragment extends PreferenceFragmentCompat {
final List<Integer> preferredButtons = UserPreferences.getFullNotificationButtons();
final String[] allButtonNames = context.getResources().getStringArray(
R.array.full_notification_buttons_options);
- final int[] buttonIDs = {2, 3, 4};
+ final int[] buttonIDs = {
+ UserPreferences.NOTIFICATION_BUTTON_SKIP,
+ UserPreferences.NOTIFICATION_BUTTON_NEXT_CHAPTER,
+ UserPreferences.NOTIFICATION_BUTTON_PLAYBACK_SPEED,
+ UserPreferences.NOTIFICATION_BUTTON_SLEEP_TIMER,
+ };
final int exactItems = 2;
final DialogInterface.OnClickListener completeListener = (dialog, which) ->
UserPreferences.setFullNotificationButtons(preferredButtons);