1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-28 18:59:01 +00:00

Show notification preview italic

Refs #148
This commit is contained in:
M66B 2019-02-19 16:30:03 +00:00
parent 1ed0fe7fce
commit 0bc172aab0

View file

@ -690,11 +690,15 @@ public class ServiceSynchronize extends LifecycleService {
if (!TextUtils.isEmpty(message.subject))
sb.append(message.subject).append("<br>");
String text = Jsoup.parse(body).text();
if (text.length() > HtmlHelper.PREVIEW_SIZE) {
sb.append(text.substring(0, HtmlHelper.PREVIEW_SIZE));
sb.append("");
} else
sb.append(text);
if (!TextUtils.isEmpty(text)) {
sb.append("<em>");
if (text.length() > HtmlHelper.PREVIEW_SIZE) {
sb.append(text.substring(0, HtmlHelper.PREVIEW_SIZE));
sb.append("");
} else
sb.append(text);
sb.append("</em>");
}
mbuilder.setStyle(new Notification.BigTextStyle().bigText(HtmlHelper.fromHtml(sb.toString())));
} catch (IOException ex) {
Log.e(ex);