From 8502d519c1df165bff6f6791dcb8f2c6e04e930c Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Tue, 7 Mar 2017 18:12:33 +0100 Subject: [PATCH] changed string from unread conversation to messages in notification --- .../conversations/services/NotificationService.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/services/NotificationService.java b/src/main/java/eu/siacs/conversations/services/NotificationService.java index 497d76429..f0460c5e5 100644 --- a/src/main/java/eu/siacs/conversations/services/NotificationService.java +++ b/src/main/java/eu/siacs/conversations/services/NotificationService.java @@ -404,8 +404,7 @@ public class NotificationService { if(messages.get(0).getConversation().getMode() == Conversation.MODE_SINGLE) { builder.setStyle(new NotificationCompat.BigTextStyle().bigText(getMergedBodies(messages))); builder.setContentText(UIHelper.getMessagePreview(mXmppConnectionService, messages.get((messages.size() - 1))).first); - } - else { + } else { final NotificationCompat.InboxStyle style = new NotificationCompat.InboxStyle(); SpannableString styledString; for (Message message : messages) { @@ -415,14 +414,14 @@ public class NotificationService { style.addLine(styledString); } builder.setStyle(style); - if(messages.size() == 1) { + int count = messages.size(); + if(count == 1) { final String name = UIHelper.getMessageDisplayName(messages.get(0)); styledString = new SpannableString(name + ": " + messages.get(0).getBody()); styledString.setSpan(new StyleSpan(Typeface.BOLD), 0, name.length(), 0); builder.setContentText(styledString); - } - else { - builder.setContentText(messages.size() + " " + mXmppConnectionService.getString(R.string.unread_conversations)); + } else { + builder.setContentText(mXmppConnectionService.getResources().getQuantityString(R.plurals.x_messages,count,count)); } } }