summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java10
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java15
2 files changed, 23 insertions, 2 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java
index 58caedc3e..222c69a1d 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java
@@ -194,6 +194,16 @@ public class UserPreferences {
}
/**
+ * Returns true if additional playback buttons should be shown in the notification even when
+ * on the lockscreen
+ *
+ * @return {@code true} if additional playback buttons should be shown, {@code false} otherwise
+ */
+ public static boolean showAdditionalNotificationButtons() {
+ return prefs.getBoolean(PREF_EXPANDED_NOTIFICATION, false);
+ }
+
+ /**
* Returns true if notifications are persistent
*
* @return {@code true} if notifications are persistent, {@code false} otherwise
diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java
index 729ea9e7a..9b37ce76d 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java
@@ -867,7 +867,13 @@ public class PlaybackService extends Service {
notificationBuilder.addAction(android.R.drawable.ic_media_rew,
getString(R.string.rewind_label),
rewindButtonPendingIntent);
- numActions++;
+ if(UserPreferences.showAdditionalNotificationButtons()) {
+ // always show the rewind button (even on the lockscreen)
+ compactActionList.add(numActions++);
+ } else {
+ numActions++;
+ }
+
if (playerStatus == PlayerStatus.PLAYING) {
PendingIntent pauseButtonPendingIntent = getPendingIntentForMediaAction(
@@ -891,7 +897,12 @@ public class PlaybackService extends Service {
notificationBuilder.addAction(android.R.drawable.ic_media_ff,
getString(R.string.fast_forward_label),
ffButtonPendingIntent);
- numActions++;
+ if(UserPreferences.showAdditionalNotificationButtons()) {
+ // always show the ff button (even on the lockscreen)
+ compactActionList.add(numActions++);
+ } else {
+ numActions++;
+ }
if (UserPreferences.isFollowQueue()) {
PendingIntent skipButtonPendingIntent = getPendingIntentForMediaAction(