diff --git a/art/ic_missed_call_notification.svg b/art/ic_missed_call_notification.svg
deleted file mode 100644
index 78f0acead..000000000
--- a/art/ic_missed_call_notification.svg
+++ /dev/null
@@ -1,344 +0,0 @@
-
-
-
-
diff --git a/src/main/java/eu/siacs/conversations/services/NotificationService.java b/src/main/java/eu/siacs/conversations/services/NotificationService.java
index 92c777fb4..55e220f62 100644
--- a/src/main/java/eu/siacs/conversations/services/NotificationService.java
+++ b/src/main/java/eu/siacs/conversations/services/NotificationService.java
@@ -36,6 +36,7 @@ import androidx.core.app.RemoteInput;
import androidx.core.content.ContextCompat;
import androidx.core.graphics.drawable.IconCompat;
+import com.google.common.base.Joiner;
import com.google.common.base.Strings;
import com.google.common.collect.Iterables;
@@ -973,19 +974,15 @@ public class NotificationService {
final Builder builder =
new NotificationCompat.Builder(mXmppConnectionService, "missed_calls");
int totalCalls = 0;
- final StringBuilder names = new StringBuilder();
+ final List names = new ArrayList<>();
long lastTime = 0;
- for (Map.Entry entry : mMissedCalls.entrySet()) {
+ for (final Map.Entry entry : mMissedCalls.entrySet()) {
final Conversational conversation = entry.getKey();
final MissedCallsInfo missedCallsInfo = entry.getValue();
- names.append(conversation.getContact().getDisplayName());
- names.append(", ");
+ names.add(conversation.getContact().getDisplayName());
totalCalls += missedCallsInfo.getNumberOfCalls();
lastTime = Math.max(lastTime, missedCallsInfo.getLastTime());
}
- if (names.length() >= 2) {
- names.delete(names.length() - 2, names.length());
- }
final String title =
(totalCalls == 1)
? mXmppConnectionService.getString(R.string.missed_call)
@@ -999,9 +996,9 @@ public class NotificationService {
builder.setContentTitle(title);
builder.setTicker(title);
if (!publicVersion) {
- builder.setContentText(names.toString());
+ builder.setContentText(Joiner.on(", ").join(names));
}
- builder.setSmallIcon(R.drawable.ic_missed_call_notification);
+ builder.setSmallIcon(R.drawable.ic_call_missed_white_24db);
builder.setGroupSummary(true);
builder.setGroup(MISSED_CALLS_GROUP);
builder.setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_CHILDREN);
@@ -1047,7 +1044,7 @@ public class NotificationService {
}
builder.setContentText(name);
}
- builder.setSmallIcon(R.drawable.ic_missed_call_notification);
+ builder.setSmallIcon(R.drawable.ic_call_missed_white_24db);
builder.setGroup(MISSED_CALLS_GROUP);
builder.setCategory(NotificationCompat.CATEGORY_CALL);
builder.setWhen(info.getLastTime());
@@ -1091,42 +1088,39 @@ public class NotificationService {
R.plurals.x_unread_conversations,
notifications.size(),
notifications.size()));
- final StringBuilder names = new StringBuilder();
+ final List names = new ArrayList<>();
Conversation conversation = null;
for (final ArrayList messages : notifications.values()) {
- if (messages.size() > 0) {
- conversation = (Conversation) messages.get(0).getConversation();
- final String name = conversation.getName().toString();
- SpannableString styledString;
- if (Config.HIDE_MESSAGE_TEXT_IN_NOTIFICATION) {
- int count = messages.size();
- styledString =
- new SpannableString(
- name
- + ": "
- + mXmppConnectionService
- .getResources()
- .getQuantityString(
- R.plurals.x_messages, count, count));
- styledString.setSpan(new StyleSpan(Typeface.BOLD), 0, name.length(), 0);
- style.addLine(styledString);
- } else {
- styledString =
- new SpannableString(
- name
- + ": "
- + UIHelper.getMessagePreview(
- mXmppConnectionService, messages.get(0))
- .first);
- styledString.setSpan(new StyleSpan(Typeface.BOLD), 0, name.length(), 0);
- style.addLine(styledString);
- }
- names.append(name);
- names.append(", ");
+ if (messages.isEmpty()) {
+ continue;
}
- }
- if (names.length() >= 2) {
- names.delete(names.length() - 2, names.length());
+ conversation = (Conversation) messages.get(0).getConversation();
+ final String name = conversation.getName().toString();
+ SpannableString styledString;
+ if (Config.HIDE_MESSAGE_TEXT_IN_NOTIFICATION) {
+ int count = messages.size();
+ styledString =
+ new SpannableString(
+ name
+ + ": "
+ + mXmppConnectionService
+ .getResources()
+ .getQuantityString(
+ R.plurals.x_messages, count, count));
+ styledString.setSpan(new StyleSpan(Typeface.BOLD), 0, name.length(), 0);
+ style.addLine(styledString);
+ } else {
+ styledString =
+ new SpannableString(
+ name
+ + ": "
+ + UIHelper.getMessagePreview(
+ mXmppConnectionService, messages.get(0))
+ .first);
+ styledString.setSpan(new StyleSpan(Typeface.BOLD), 0, name.length(), 0);
+ style.addLine(styledString);
+ }
+ names.add(name);
}
final String contentTitle =
mXmppConnectionService
@@ -1137,7 +1131,7 @@ public class NotificationService {
notifications.size());
mBuilder.setContentTitle(contentTitle);
mBuilder.setTicker(contentTitle);
- mBuilder.setContentText(names.toString());
+ mBuilder.setContentText(Joiner.on(", ").join(names));
mBuilder.setStyle(style);
if (conversation != null) {
mBuilder.setContentIntent(createContentIntent(conversation));
diff --git a/src/main/res/drawable-hdpi/ic_missed_call_notification.png b/src/main/res/drawable-hdpi/ic_missed_call_notification.png
deleted file mode 100644
index 3608ebd92..000000000
Binary files a/src/main/res/drawable-hdpi/ic_missed_call_notification.png and /dev/null differ
diff --git a/src/main/res/drawable-mdpi/ic_missed_call_notification.png b/src/main/res/drawable-mdpi/ic_missed_call_notification.png
deleted file mode 100644
index 9c6c37da0..000000000
Binary files a/src/main/res/drawable-mdpi/ic_missed_call_notification.png and /dev/null differ
diff --git a/src/main/res/drawable-xhdpi/ic_missed_call_notification.png b/src/main/res/drawable-xhdpi/ic_missed_call_notification.png
deleted file mode 100644
index 80cd15819..000000000
Binary files a/src/main/res/drawable-xhdpi/ic_missed_call_notification.png and /dev/null differ
diff --git a/src/main/res/drawable-xxhdpi/ic_missed_call_notification.png b/src/main/res/drawable-xxhdpi/ic_missed_call_notification.png
deleted file mode 100644
index 0072d2ef0..000000000
Binary files a/src/main/res/drawable-xxhdpi/ic_missed_call_notification.png and /dev/null differ
diff --git a/src/main/res/drawable-xxxhdpi/ic_missed_call_notification.png b/src/main/res/drawable-xxxhdpi/ic_missed_call_notification.png
deleted file mode 100644
index b4343bb10..000000000
Binary files a/src/main/res/drawable-xxxhdpi/ic_missed_call_notification.png and /dev/null differ
diff --git a/src/main/res/drawable/ic_call_missed_white_24db.xml b/src/main/res/drawable/ic_call_missed_white_24db.xml
new file mode 100644
index 000000000..d80ce31bd
--- /dev/null
+++ b/src/main/res/drawable/ic_call_missed_white_24db.xml
@@ -0,0 +1,5 @@
+
+
+