Change summary
src/main/java/eu/siacs/conversations/services/NotificationService.java | 11
1 file changed, 5 insertions(+), 6 deletions(-)
Detailed changes
@@ -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));
}
}
}