no-urgent notification title

This commit is contained in:
AdrianLxM 2017-11-06 21:38:42 +01:00
parent 2e6a136de6
commit f2e44e8ab9
3 changed files with 8 additions and 3 deletions

View file

@ -85,15 +85,17 @@ public class NotificationStore {
new NotificationCompat.Builder(context)
.setSmallIcon(R.drawable.ic_notification)
.setLargeIcon(largeIcon)
.setContentTitle("Urgent alarm")
.setContentText(n.text)
.setPriority(NotificationCompat.PRIORITY_HIGH)
.setPriority(NotificationCompat.PRIORITY_MAX)
.setDeleteIntent(DismissNotificationService.deleteIntent(n.id));
if (n.level == Notification.URGENT) {
notificationBuilder.setVibrate(new long[]{1000, 1000, 1000, 1000})
.setContentTitle(MainApp.sResources.getString(R.string.urgent_alarm))
.setSound(sound, AudioAttributes.USAGE_ALARM);
} else {
notificationBuilder.setVibrate(new long[]{0, 100, 50, 100, 50});
notificationBuilder.setVibrate(new long[]{0, 100, 50, 100, 50})
.setContentTitle(MainApp.sResources.getString(R.string.info))
;
}
mgr.notify(n.id, notificationBuilder.build());
}

View file

@ -114,6 +114,7 @@ public class KeepAliveReceiver extends BroadcastReceiver {
}
}
//called by MainAPP at first app start
public void setAlarm(Context context) {
shortenSnoozeInterval();

View file

@ -769,5 +769,7 @@
<string name="pump_unreachable_threshold">Pump unreachable threshold [min]</string>
<string name="key_pump_unreachable_threshold" translatable="false">pump_unreachable_threshold</string>
<string name="key_missed_bg_readings_threshold" translatable="false">missed_bg_readings_threshold</string>
<string name="urgent_alarm">Urgent Alarm</string>
<string name="info">INFO</string>
</resources>