Prefix print name with date/time

pull/214/head
M66B 1 year ago
parent 20dc28ab38
commit 8cf977664b

@ -322,6 +322,7 @@ public class FragmentDialogPrint extends FragmentDialogBase {
document.body().prependChild(header); document.body().prependChild(header);
} }
args.putLong("received", message.received);
return new String[]{message.subject, document.body().html()}; return new String[]{message.subject, document.body().html()};
} }
@ -360,9 +361,10 @@ public class FragmentDialogPrint extends FragmentDialogBase {
} }
PrintManager printManager = (PrintManager) context.getSystemService(Context.PRINT_SERVICE); PrintManager printManager = (PrintManager) context.getSystemService(Context.PRINT_SERVICE);
String jobName = activity.getString(R.string.app_name); String jobName = new SimpleDateFormat("yyyy-MM-dd HH:mm")
.format(args.getLong("received"));
if (!TextUtils.isEmpty(data[0])) if (!TextUtils.isEmpty(data[0]))
jobName += " - " + data[0]; jobName += " " + data[0];
Log.i("Print queue job=" + jobName); Log.i("Print queue job=" + jobName);
PrintDocumentAdapter adapter = printWebView.createPrintDocumentAdapter(jobName); PrintDocumentAdapter adapter = printWebView.createPrintDocumentAdapter(jobName);

Loading…
Cancel
Save