From 17fe0986b8cfae7d98e1a22af689948df10670e6 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 20 Sep 2019 20:54:27 +0200 Subject: [PATCH] Improved print header --- .../eu/faircode/email/FragmentMessages.java | 44 +++++++++++++------ 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 36a661e3f0..f09d80d6fe 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -4484,38 +4484,56 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. if (message.from != null && message.from.length > 0) { Element span = document.createElement("span"); - span.text(getString(R.string.title_from) + " " + MessageHelper.formatAddresses(message.from)); - p.append(span.html() + "
"); + Element strong = document.createElement("strong"); + strong.text(getString(R.string.title_from)); + span.appendChild(strong); + span.appendText(" " + MessageHelper.formatAddresses(message.from)); + span.appendElement("br"); + p.appendChild(span); } if (message.to != null && message.to.length > 0) { Element span = document.createElement("span"); - span.text(getString(R.string.title_to) + " " + MessageHelper.formatAddresses(message.to)); - p.append(span.html() + "
"); + Element strong = document.createElement("strong"); + strong.text(getString(R.string.title_to)); + span.appendChild(strong); + span.appendText(" " + MessageHelper.formatAddresses(message.to)); + span.appendElement("br"); + p.appendChild(span); } if (message.cc != null && message.cc.length > 0) { Element span = document.createElement("span"); - span.text(getString(R.string.title_cc) + " " + MessageHelper.formatAddresses(message.cc)); - p.append(span.html() + "
"); + Element strong = document.createElement("strong"); + strong.text(getString(R.string.title_cc)); + span.appendChild(strong); + span.appendText(" " + MessageHelper.formatAddresses(message.cc)); + span.appendElement("br"); + p.appendChild(span); } { - Element span = document.createElement("span"); DateFormat DTF = Helper.getDateTimeInstance(context, SimpleDateFormat.LONG, SimpleDateFormat.LONG); - span.text(getString(R.string.title_received) + " " + DTF.format(message.received)); - p.append(span.html() + "
"); + + Element span = document.createElement("span"); + Element strong = document.createElement("strong"); + strong.text(getString(R.string.title_received)); + span.appendChild(strong); + span.appendText(" " + DTF.format(message.received)); + span.appendElement("br"); + p.appendChild(span); } if (!TextUtils.isEmpty(message.subject)) { Element span = document.createElement("span"); - span.text(message.subject); - p.append(span.html() + "
"); + span.appendText(message.subject); + span.appendElement("br"); + p.appendChild(span); } - p.append("

"); + p.appendElement("hr").appendElement("br"); - body.prepend(p.html()); + body.prependChild(p); } return new String[]{message.subject, document.html()};