From 465eef128880a2837e62979a09eba790a3caceba Mon Sep 17 00:00:00 2001 From: jacques Date: Thu, 1 Apr 2021 21:27:12 +0200 Subject: [PATCH] Add led color and vibration to the notification --- app/src/main/java/net/foucry/pilldroid/AlarmReceiver.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/net/foucry/pilldroid/AlarmReceiver.java b/app/src/main/java/net/foucry/pilldroid/AlarmReceiver.java index a8f1b78..b99ff00 100644 --- a/app/src/main/java/net/foucry/pilldroid/AlarmReceiver.java +++ b/app/src/main/java/net/foucry/pilldroid/AlarmReceiver.java @@ -85,6 +85,10 @@ public class AlarmReceiver extends BroadcastReceiver { String CHANNEL_ID = "PillDroid"; NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance); channel.setDescription(description); + channel.enableLights(true); + channel.setLightColor(R.color.led); + channel.enableVibration(true); + channel.setVibrationPattern(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400}); // Register the channel with the system; you can't change the importance // or other notification behaviors after this NotificationManager notificationManager = context.getSystemService(NotificationManager.class);