changed string from unread conversation to messages in notification

This commit is contained in:
Daniel Gultsch 2017-03-07 18:12:33 +01:00
parent 5b17734287
commit 8502d519c1
1 changed files with 5 additions and 6 deletions

View File

@ -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));
}
}
}