Summary preview is optional

pull/162/head
M66B 5 years ago
parent 94a3419517
commit c49d7968b7

@ -2765,25 +2765,26 @@ class Core {
.setVisibility(NotificationCompat.VISIBILITY_PRIVATE) .setVisibility(NotificationCompat.VISIBILITY_PRIVATE)
.setPublicVersion(pub); .setPublicVersion(pub);
if (redacted) if (notify_preview)
builder.setContentText(context.getString(R.string.title_setup_biometrics)); if (redacted)
else { builder.setContentText(context.getString(R.string.title_setup_biometrics));
DateFormat DTF = Helper.getDateTimeInstance(context, SimpleDateFormat.SHORT, SimpleDateFormat.SHORT); else {
StringBuilder sb = new StringBuilder(); DateFormat DTF = Helper.getDateTimeInstance(context, SimpleDateFormat.SHORT, SimpleDateFormat.SHORT);
for (EntityMessage message : messages) { StringBuilder sb = new StringBuilder();
sb.append("<strong>").append(messageContact.get(message).getDisplayName(name_email)).append("</strong>"); for (EntityMessage message : messages) {
if (!TextUtils.isEmpty(message.subject)) sb.append("<strong>").append(messageContact.get(message).getDisplayName(name_email)).append("</strong>");
sb.append(": ").append(message.subject); if (!TextUtils.isEmpty(message.subject))
sb.append(" ").append(DTF.format(message.received)); sb.append(": ").append(message.subject);
sb.append("<br>"); sb.append(" ").append(DTF.format(message.received));
} sb.append("<br>");
}
builder.setContentText(sb.toString()); builder.setContentText(sb.toString());
builder.setStyle(new NotificationCompat.BigTextStyle() builder.setStyle(new NotificationCompat.BigTextStyle()
.bigText(HtmlHelper.fromHtml(sb.toString())) .bigText(HtmlHelper.fromHtml(sb.toString()))
.setSummaryText(title)); .setSummaryText(title));
} }
notifications.add(builder.build()); notifications.add(builder.build());
} }

Loading…
Cancel
Save