From 8c338924ad011cd02da79d649b215db7554bd0e5 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 11 Feb 2019 08:02:44 +0000 Subject: [PATCH] Added HTML view to EML viewer --- .../java/eu/faircode/email/ActivityEml.java | 7 ++++-- app/src/main/res/layout/activity_eml.xml | 25 ++++++++++++++++++- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ActivityEml.java b/app/src/main/java/eu/faircode/email/ActivityEml.java index 110e66ba3c..216617a687 100644 --- a/app/src/main/java/eu/faircode/email/ActivityEml.java +++ b/app/src/main/java/eu/faircode/email/ActivityEml.java @@ -37,6 +37,7 @@ public class ActivityEml extends ActivityBase { final TextView tvSubject = findViewById(R.id.tvSubject); final TextView tvParts = findViewById(R.id.tvParts); final TextView tvBody = findViewById(R.id.tvBody); + final TextView tvHtml = findViewById(R.id.tvHtml); final TextView tvEml = findViewById(R.id.tvEml); final ContentLoadingProgressBar pbWait = findViewById(R.id.pbWait); final Group grpEml = findViewById(R.id.grpEml); @@ -102,8 +103,8 @@ public class ActivityEml extends ActivityBase { } result.parts = HtmlHelper.fromHtml(sb.toString()); - String html = HtmlHelper.sanitize(parts.getHtml(context), true); - result.body = HtmlHelper.fromHtml(html); + result.html = HtmlHelper.sanitize(parts.getHtml(context), true); + result.body = HtmlHelper.fromHtml(result.html); ByteArrayOutputStream bos = new ByteArrayOutputStream(); mmessage.writeTo(bos); @@ -126,6 +127,7 @@ public class ActivityEml extends ActivityBase { tvSubject.setText(result.subject); tvParts.setText(result.parts); tvBody.setText(result.body); + tvHtml.setText(result.html); tvEml.setText(result.eml); grpEml.setVisibility(View.VISIBLE); } @@ -149,6 +151,7 @@ public class ActivityEml extends ActivityBase { String subject; Spanned parts; Spanned body; + String html; String eml; } } diff --git a/app/src/main/res/layout/activity_eml.xml b/app/src/main/res/layout/activity_eml.xml index b9e972137f..67e6fe7c60 100644 --- a/app/src/main/res/layout/activity_eml.xml +++ b/app/src/main/res/layout/activity_eml.xml @@ -171,7 +171,7 @@ app:layout_constraintTop_toBottomOf="@id/vSeparatorBody" /> + + + + \ No newline at end of file