aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/util/Constants.java1
-rw-r--r--app/src/main/java/github/daneren2005/dsub/util/Notifications.java4
-rw-r--r--app/src/main/res/values/strings.xml2
-rw-r--r--app/src/main/res/xml/settings_playback.xml6
4 files changed, 13 insertions, 0 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/util/Constants.java b/app/src/main/java/github/daneren2005/dsub/util/Constants.java
index 9aebef83..541f342e 100644
--- a/app/src/main/java/github/daneren2005/dsub/util/Constants.java
+++ b/app/src/main/java/github/daneren2005/dsub/util/Constants.java
@@ -172,6 +172,7 @@ public final class Constants {
public static final String PREFERENCES_KEY_BATCH_MODE = "batchMode";
public static final String PREFERENCES_KEY_CAST_GAPLESS_PLAYBACK = "castingGaplessPlayback";
public static final String PREFERENCES_KEY_CAST_STREAM_ORIGINAL = "castStreamOriginal";
+ public static final String PREFERENCES_KEY_HEADS_UP_NOTIFICATION = "headsUpNotification";
public static final String OFFLINE_SCROBBLE_COUNT = "scrobbleCount";
public static final String OFFLINE_SCROBBLE_ID = "scrobbleID";
diff --git a/app/src/main/java/github/daneren2005/dsub/util/Notifications.java b/app/src/main/java/github/daneren2005/dsub/util/Notifications.java
index 356ec552..a59a9766 100644
--- a/app/src/main/java/github/daneren2005/dsub/util/Notifications.java
+++ b/app/src/main/java/github/daneren2005/dsub/util/Notifications.java
@@ -74,6 +74,10 @@ public final class Notifications {
}
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
notification.visibility = Notification.VISIBILITY_PUBLIC;
+
+ if(Util.getPreferences(context).getBoolean(Constants.PREFERENCES_KEY_HEADS_UP_NOTIFICATION, false)) {
+ notification.vibrate = new long[0];
+ }
}
RemoteViews smallContentView = new RemoteViews(context.getPackageName(), R.layout.notification);
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 6b38f337..ee4af53c 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -470,6 +470,8 @@
<string name="settings.shuffle_by_album.false">Shuffle all songs together</string>
<string name="settings.casting_stream_original">Stream original</string>
<string name="settings.casting_stream_original_summary">Stream original files where supported by cast device</string>
+ <string name="settings.heads_up_notification">Heads Up Notifications (5.0+)</string>
+ <string name="settings.heads_up_notification_summary">Show playing notifications as Heads Up notifications (Android Lollipop+ only)</string>
<string name="shuffle.title">Shuffle By</string>
<string name="shuffle.startYear">Start Year:</string>
diff --git a/app/src/main/res/xml/settings_playback.xml b/app/src/main/res/xml/settings_playback.xml
index a4ea443e..91b0435b 100644
--- a/app/src/main/res/xml/settings_playback.xml
+++ b/app/src/main/res/xml/settings_playback.xml
@@ -41,6 +41,12 @@
android:defaultValue="false"/>
<CheckBoxPreference
+ android:title="@string/settings.heads_up_notification"
+ android:summary="@string/settings.heads_up_notification_summary"
+ android:key="headsUpNotification"
+ android:defaultValue="false"/>
+
+ <CheckBoxPreference
android:title="@string/settings.play_now_after"
android:summary="@string/settings.play_now_after_summary"
android:key="playNowAfter"