Enable creation time in notification

This commit is contained in:
Erwan Croze 2018-08-21 10:48:26 +02:00
parent 5a3491a4bb
commit d2190fd998
2 changed files with 12 additions and 0 deletions

View file

@ -60,6 +60,7 @@ public class ApiTwentyOnePlus {
.setPriority(Notification.PRIORITY_HIGH)
.setNumber(msgCount)
.setWhen(System.currentTimeMillis())
.setShowWhen(true)
.build();
return notif;
@ -81,6 +82,7 @@ public class ApiTwentyOnePlus {
.setLights(ContextCompat.getColor(context, R.color.notification_color_led),
context.getResources().getInteger(R.integer.notification_ms_on),
context.getResources().getInteger(R.integer.notification_ms_off))
.setShowWhen(true)
.build();
return notif;
@ -103,6 +105,7 @@ public class ApiTwentyOnePlus {
context.getResources().getInteger(R.integer.notification_ms_off))
.setWhen(System.currentTimeMillis())
.setPriority(priority)
.setShowWhen(true)
.build();
} else {
notif = new Notification.Builder(context)
@ -117,6 +120,7 @@ public class ApiTwentyOnePlus {
context.getResources().getInteger(R.integer.notification_ms_off))
.setPriority(priority)
.setWhen(System.currentTimeMillis())
.setShowWhen(true)
.build();
}
@ -143,6 +147,7 @@ public class ApiTwentyOnePlus {
context.getResources().getInteger(R.integer.notification_ms_off))
.setPriority(Notification.PRIORITY_HIGH)
.setWhen(System.currentTimeMillis())
.setShowWhen(true)
.build();
return notif;
@ -164,6 +169,7 @@ public class ApiTwentyOnePlus {
context.getResources().getInteger(R.integer.notification_ms_off))
.setWhen(System.currentTimeMillis())
.setPriority(Notification.PRIORITY_HIGH)
.setShowWhen(true)
.build();
return notif;

View file

@ -88,6 +88,7 @@ public class ApiTwentySixPlus {
.setPriority(Notification.PRIORITY_HIGH)
.setNumber(msgCount)
.setWhen(System.currentTimeMillis())
.setShowWhen(true)
.build();
return notif;
@ -108,6 +109,7 @@ public class ApiTwentySixPlus {
.setVisibility(Notification.VISIBILITY_PUBLIC)
.setPriority(Notification.PRIORITY_HIGH)
.setWhen(System.currentTimeMillis())
.setShowWhen(true)
.build();
return notif;
@ -127,6 +129,7 @@ public class ApiTwentySixPlus {
.setVisibility(Notification.VISIBILITY_SECRET)
.setPriority(priority)
.setWhen(System.currentTimeMillis())
.setShowWhen(true)
.build();
} else {
notif = new Notification.Builder(context, context.getString(R.string.notification_service_channel_id))
@ -138,6 +141,7 @@ public class ApiTwentySixPlus {
.setVisibility(Notification.VISIBILITY_SECRET)
.setPriority(priority)
.setWhen(System.currentTimeMillis())
.setShowWhen(true)
.build();
}
@ -161,6 +165,7 @@ public class ApiTwentySixPlus {
.setVisibility(Notification.VISIBILITY_PRIVATE)
.setPriority(Notification.PRIORITY_HIGH)
.setWhen(System.currentTimeMillis())
.setShowWhen(true)
.build();
return notif;
@ -179,6 +184,7 @@ public class ApiTwentySixPlus {
.setVisibility(Notification.VISIBILITY_PRIVATE)
.setPriority(Notification.PRIORITY_HIGH)
.setWhen(System.currentTimeMillis())
.setShowWhen(true)
.build();
return notif;