added some lines to get foreground notification (a little) less intrusive

This commit is contained in:
Ialokim
2018-12-16 17:51:31 +01:00
parent 777dd081d3
commit 33388b426b
2 changed files with 4 additions and 0 deletions

View File

@@ -36,6 +36,7 @@ public class NotificationSupport {
Channel.FOREGROUND, Channel.FOREGROUND,
"Gotify foreground notification", "Gotify foreground notification",
NotificationManager.IMPORTANCE_LOW); NotificationManager.IMPORTANCE_LOW);
foreground.setShowBadge(false);
NotificationChannel messagesImportanceMin = NotificationChannel messagesImportanceMin =
new NotificationChannel( new NotificationChannel(

View File

@@ -168,6 +168,9 @@ public class WebSocketService extends Service {
new NotificationCompat.Builder(this, NotificationSupport.Channel.FOREGROUND) new NotificationCompat.Builder(this, NotificationSupport.Channel.FOREGROUND)
.setSmallIcon(R.drawable.ic_gotify) .setSmallIcon(R.drawable.ic_gotify)
.setOngoing(true) .setOngoing(true)
.setPriority(NotificationCompat.PRIORITY_MIN)
.setShowWhen(false)
.setWhen(0)
.setContentTitle(getString(R.string.app_name)) .setContentTitle(getString(R.string.app_name))
.setContentText(message) .setContentText(message)
.setStyle(new NotificationCompat.BigTextStyle().bigText(message)) .setStyle(new NotificationCompat.BigTextStyle().bigText(message))