mirror of
https://github.com/jfoucry/Pilldroid.git
synced 2024-11-22 04:29:22 +01:00
Add led color and vibration to the notification
This commit is contained in:
parent
9e77f6ac11
commit
465eef1288
1 changed files with 4 additions and 0 deletions
|
@ -85,6 +85,10 @@ public class AlarmReceiver extends BroadcastReceiver {
|
||||||
String CHANNEL_ID = "PillDroid";
|
String CHANNEL_ID = "PillDroid";
|
||||||
NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);
|
NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);
|
||||||
channel.setDescription(description);
|
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
|
// Register the channel with the system; you can't change the importance
|
||||||
// or other notification behaviors after this
|
// or other notification behaviors after this
|
||||||
NotificationManager notificationManager = context.getSystemService(NotificationManager.class);
|
NotificationManager notificationManager = context.getSystemService(NotificationManager.class);
|
||||||
|
|
Loading…
Reference in a new issue