mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 04:35:57 +00:00
Improved print header
This commit is contained in:
parent
b13328175a
commit
17fe0986b8
1 changed files with 31 additions and 13 deletions
|
@ -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() + "<br>");
|
||||
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() + "<br>");
|
||||
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() + "<br>");
|
||||
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() + "<br>");
|
||||
|
||||
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() + "<br>");
|
||||
span.appendText(message.subject);
|
||||
span.appendElement("br");
|
||||
p.appendChild(span);
|
||||
}
|
||||
|
||||
p.append("<hr><br>");
|
||||
p.appendElement("hr").appendElement("br");
|
||||
|
||||
body.prepend(p.html());
|
||||
body.prependChild(p);
|
||||
}
|
||||
|
||||
return new String[]{message.subject, document.html()};
|
||||
|
|
Loading…
Reference in a new issue