diff options
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/util/Constants.java | 1 | ||||
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/util/Notifications.java | 4 |
2 files changed, 5 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); |