Show sender in notification bold

pull/72/head
M66B 6 years ago
parent 830a13f278
commit 8466235cb2

@ -37,6 +37,7 @@ import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.SystemClock; import android.os.SystemClock;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.text.Html;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
@ -303,14 +304,14 @@ public class ServiceSynchronize extends LifecycleService {
DateFormat df = SimpleDateFormat.getDateTimeInstance(SimpleDateFormat.SHORT, SimpleDateFormat.SHORT); DateFormat df = SimpleDateFormat.getDateTimeInstance(SimpleDateFormat.SHORT, SimpleDateFormat.SHORT);
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for (EntityMessage message : messages) { for (EntityMessage message : messages) {
sb.append(MessageHelper.getFormattedAddresses(message.from, false)); sb.append("<strong>").append(MessageHelper.getFormattedAddresses(message.from, false)).append("</strong>");
if (!TextUtils.isEmpty(message.subject)) if (!TextUtils.isEmpty(message.subject))
sb.append(": ").append(message.subject); sb.append(": ").append(message.subject);
sb.append(" ").append(df.format(new Date(message.sent))); sb.append(" ").append(df.format(new Date(message.sent)));
sb.append("\n"); sb.append("\n");
} }
builder.setStyle(new Notification.BigTextStyle().bigText(sb.toString())); builder.setStyle(new Notification.BigTextStyle().bigText(Html.fromHtml(sb.toString())));
} }
return builder; return builder;

Loading…
Cancel
Save