diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser
index a823422497..983ae46dd6 100644
Binary files a/.idea/caches/build_file_checksums.ser and b/.idea/caches/build_file_checksums.ser differ
diff --git a/app/src/main/java/eu/faircode/email/FragmentMessage.java b/app/src/main/java/eu/faircode/email/FragmentMessage.java
index 5053019054..ff5af43264 100644
--- a/app/src/main/java/eu/faircode/email/FragmentMessage.java
+++ b/app/src/main/java/eu/faircode/email/FragmentMessage.java
@@ -259,7 +259,7 @@ public class FragmentMessage extends FragmentEx {
} else if (prefs.getBoolean("webview", false)) {
Bundle args = new Bundle();
- args.putString("link", url);
+ args.putString("url", url);
FragmentWebView fragment = new FragmentWebView();
fragment.setArguments(args);
@@ -584,6 +584,9 @@ public class FragmentMessage extends FragmentEx {
case R.id.menu_reply_all:
onMenuReplyAll();
return true;
+ case R.id.menu_show_html:
+ onMenuShowHtml();
+ return true;
case R.id.menu_answer:
onMenuAnswer();
return true;
@@ -625,6 +628,29 @@ public class FragmentMessage extends FragmentEx {
.putExtra("reference", message.id));
}
+ private void onMenuShowHtml() {
+ new SimpleTask() {
+ @Override
+ protected String onLoad(Context context, Bundle args) throws Throwable {
+ return message.read(context);
+ }
+
+ @Override
+ protected void onLoaded(Bundle a, String html) {
+ Bundle args = new Bundle();
+ args.putString("html", html);
+ args.putString("from", MessageHelper.getFormattedAddresses(message.from, true));
+
+ FragmentWebView fragment = new FragmentWebView();
+ fragment.setArguments(args);
+
+ FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
+ fragmentTransaction.replace(R.id.content_frame, fragment).addToBackStack("webview");
+ fragmentTransaction.commit();
+ }
+ }.load(this, new Bundle());
+ }
+
private void onMenuAnswer() {
DB.getInstance(getContext()).answer().liveAnswers().observe(getViewLifecycleOwner(), new Observer>() {
@Override
diff --git a/app/src/main/java/eu/faircode/email/FragmentWebView.java b/app/src/main/java/eu/faircode/email/FragmentWebView.java
index 73dd836cfe..4ac69fd803 100644
--- a/app/src/main/java/eu/faircode/email/FragmentWebView.java
+++ b/app/src/main/java/eu/faircode/email/FragmentWebView.java
@@ -35,23 +35,19 @@ import androidx.annotation.Nullable;
// https://developer.android.com/reference/android/webkit/WebView
public class FragmentWebView extends FragmentEx {
- private String url = null;
-
@Override
@Nullable
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_webview, container, false);
final ProgressBar progressBar = view.findViewById(R.id.progressbar);
- WebView webview = view.findViewById(R.id.webview);
+ final WebView webview = view.findViewById(R.id.webview);
progressBar.setProgress(0);
progressBar.setVisibility(View.VISIBLE);
WebSettings settings = webview.getSettings();
settings.setJavaScriptEnabled(true);
- settings.setLoadWithOverviewMode(true);
- settings.setUseWideViewPort(true);
settings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
webview.setWebViewClient(new WebViewClient() {
@@ -71,9 +67,31 @@ public class FragmentWebView extends FragmentEx {
});
Bundle args = getArguments();
- url = (args == null ? null : args.getString("link"));
- webview.loadUrl(url);
- setSubtitle(url);
+ if (args.containsKey("url")) {
+ String url = args.getString("url");
+ webview.loadUrl(url);
+ setSubtitle(url);
+ } else if (args.containsKey("html")) {
+ String html = args.getString("html");
+ String from = args.getString("from");
+ webview.loadDataWithBaseURL("email://", html, "text/html", "UTF-8", null);
+ setSubtitle(from);
+ }
+
+ ((ActivityBase) getActivity()).addBackPressedListener(new ActivityBase.IBackPressedListener() {
+ @Override
+ public boolean onBackPressed() {
+ boolean can = webview.canGoBack();
+ if (can)
+ webview.goBack();
+
+ Bundle args = getArguments();
+ if (args.containsKey("from") && !webview.canGoBack())
+ setSubtitle(args.getString("from"));
+
+ return can;
+ }
+ });
return view;
}
diff --git a/app/src/main/res/menu/menu_view.xml b/app/src/main/res/menu/menu_view.xml
index d002ff6063..df5b3681d1 100644
--- a/app/src/main/res/menu/menu_view.xml
+++ b/app/src/main/res/menu/menu_view.xml
@@ -26,6 +26,12 @@
android:title="@string/title_reply_all"
app:showAsAction="never" />
+
+
- Mark unread
Forward
Reply to all
+ Show original
Trash
Spam
Move
diff --git a/app/src/main/res/values-ar-rBH/strings.xml b/app/src/main/res/values-ar-rBH/strings.xml
index a6efddd31c..c62a4039f9 100644
--- a/app/src/main/res/values-ar-rBH/strings.xml
+++ b/app/src/main/res/values-ar-rBH/strings.xml
@@ -134,6 +134,7 @@
Mark unread
Forward
Reply to all
+ Show original
Trash
Spam
Move
diff --git a/app/src/main/res/values-ar-rEG/strings.xml b/app/src/main/res/values-ar-rEG/strings.xml
index a6efddd31c..c62a4039f9 100644
--- a/app/src/main/res/values-ar-rEG/strings.xml
+++ b/app/src/main/res/values-ar-rEG/strings.xml
@@ -134,6 +134,7 @@
Mark unread
Forward
Reply to all
+ Show original
Trash
Spam
Move
diff --git a/app/src/main/res/values-ar-rSA/strings.xml b/app/src/main/res/values-ar-rSA/strings.xml
index a6efddd31c..c62a4039f9 100644
--- a/app/src/main/res/values-ar-rSA/strings.xml
+++ b/app/src/main/res/values-ar-rSA/strings.xml
@@ -134,6 +134,7 @@
Mark unread
Forward
Reply to all
+ Show original
Trash
Spam
Move
diff --git a/app/src/main/res/values-ar-rYE/strings.xml b/app/src/main/res/values-ar-rYE/strings.xml
index a6efddd31c..c62a4039f9 100644
--- a/app/src/main/res/values-ar-rYE/strings.xml
+++ b/app/src/main/res/values-ar-rYE/strings.xml
@@ -134,6 +134,7 @@
Mark unread
Forward
Reply to all
+ Show original
Trash
Spam
Move
diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml
index a6efddd31c..c62a4039f9 100644
--- a/app/src/main/res/values-ar/strings.xml
+++ b/app/src/main/res/values-ar/strings.xml
@@ -134,6 +134,7 @@
Mark unread
Forward
Reply to all
+ Show original
Trash
Spam
Move
diff --git a/app/src/main/res/values-ca/strings.xml b/app/src/main/res/values-ca/strings.xml
index 5b63fc95b6..a92f7a9f21 100644
--- a/app/src/main/res/values-ca/strings.xml
+++ b/app/src/main/res/values-ca/strings.xml
@@ -118,6 +118,7 @@
Mark unread
Forward
Reply to all
+ Show original
Trash
Spam
Move
diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml
index e924d4a22f..9d6a0c5882 100644
--- a/app/src/main/res/values-cs/strings.xml
+++ b/app/src/main/res/values-cs/strings.xml
@@ -126,6 +126,7 @@
Mark unread
Forward
Reply to all
+ Show original
Trash
Spam
Move
diff --git a/app/src/main/res/values-da/strings.xml b/app/src/main/res/values-da/strings.xml
index 30e1a98c35..4b217c60b3 100644
--- a/app/src/main/res/values-da/strings.xml
+++ b/app/src/main/res/values-da/strings.xml
@@ -118,6 +118,7 @@
Markér som ulæst
Videresend
Svar alle
+ Show original
Papirkurv
Spam
Flyt
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index 16e8743d44..779ffe0e08 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -118,6 +118,7 @@
Als ungelesen markieren
Weiterleiten
Antworten an alle
+ Show original
Papierkorb
Spam
Verschieben
diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml
index 5b63fc95b6..a92f7a9f21 100644
--- a/app/src/main/res/values-el/strings.xml
+++ b/app/src/main/res/values-el/strings.xml
@@ -118,6 +118,7 @@
Mark unread
Forward
Reply to all
+ Show original
Trash
Spam
Move
diff --git a/app/src/main/res/values-en/strings.xml b/app/src/main/res/values-en/strings.xml
index 5b63fc95b6..a92f7a9f21 100644
--- a/app/src/main/res/values-en/strings.xml
+++ b/app/src/main/res/values-en/strings.xml
@@ -118,6 +118,7 @@
Mark unread
Forward
Reply to all
+ Show original
Trash
Spam
Move
diff --git a/app/src/main/res/values-es-rES/strings.xml b/app/src/main/res/values-es-rES/strings.xml
index 5b63fc95b6..a92f7a9f21 100644
--- a/app/src/main/res/values-es-rES/strings.xml
+++ b/app/src/main/res/values-es-rES/strings.xml
@@ -118,6 +118,7 @@
Mark unread
Forward
Reply to all
+ Show original
Trash
Spam
Move
diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml
index 5b63fc95b6..a92f7a9f21 100644
--- a/app/src/main/res/values-fi/strings.xml
+++ b/app/src/main/res/values-fi/strings.xml
@@ -118,6 +118,7 @@
Mark unread
Forward
Reply to all
+ Show original
Trash
Spam
Move
diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml
index 7ac25a9519..8285ec3698 100644
--- a/app/src/main/res/values-fr/strings.xml
+++ b/app/src/main/res/values-fr/strings.xml
@@ -118,6 +118,7 @@
Marquer comme non lu
Transférer
Répondre à tous
+ Show original
Corbeille
Spam
Déplacer
diff --git a/app/src/main/res/values-he/strings.xml b/app/src/main/res/values-he/strings.xml
index aa72ad14b3..bd745818dd 100644
--- a/app/src/main/res/values-he/strings.xml
+++ b/app/src/main/res/values-he/strings.xml
@@ -126,6 +126,7 @@
Mark unread
Forward
Reply to all
+ Show original
Trash
Spam
Move
diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml
index 5b63fc95b6..a92f7a9f21 100644
--- a/app/src/main/res/values-hu/strings.xml
+++ b/app/src/main/res/values-hu/strings.xml
@@ -118,6 +118,7 @@
Mark unread
Forward
Reply to all
+ Show original
Trash
Spam
Move
diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml
index 7457a3bd84..403ed048a7 100644
--- a/app/src/main/res/values-it/strings.xml
+++ b/app/src/main/res/values-it/strings.xml
@@ -118,6 +118,7 @@
Segna come non letto
Inoltra
Rispondi a tutti
+ Show original
Cestino
Posta indesiderata
Sposta
diff --git a/app/src/main/res/values-iw/strings.xml b/app/src/main/res/values-iw/strings.xml
index aa72ad14b3..bd745818dd 100644
--- a/app/src/main/res/values-iw/strings.xml
+++ b/app/src/main/res/values-iw/strings.xml
@@ -126,6 +126,7 @@
Mark unread
Forward
Reply to all
+ Show original
Trash
Spam
Move
diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml
index d94ccd0845..91ed306227 100644
--- a/app/src/main/res/values-ja/strings.xml
+++ b/app/src/main/res/values-ja/strings.xml
@@ -114,6 +114,7 @@
Mark unread
Forward
Reply to all
+ Show original
Trash
Spam
Move
diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml
index d94ccd0845..91ed306227 100644
--- a/app/src/main/res/values-ko/strings.xml
+++ b/app/src/main/res/values-ko/strings.xml
@@ -114,6 +114,7 @@
Mark unread
Forward
Reply to all
+ Show original
Trash
Spam
Move
diff --git a/app/src/main/res/values-nb/strings.xml b/app/src/main/res/values-nb/strings.xml
index 5b63fc95b6..a92f7a9f21 100644
--- a/app/src/main/res/values-nb/strings.xml
+++ b/app/src/main/res/values-nb/strings.xml
@@ -118,6 +118,7 @@
Mark unread
Forward
Reply to all
+ Show original
Trash
Spam
Move
diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml
index 5b63fc95b6..a92f7a9f21 100644
--- a/app/src/main/res/values-nl/strings.xml
+++ b/app/src/main/res/values-nl/strings.xml
@@ -118,6 +118,7 @@
Mark unread
Forward
Reply to all
+ Show original
Trash
Spam
Move
diff --git a/app/src/main/res/values-no/strings.xml b/app/src/main/res/values-no/strings.xml
index 5b63fc95b6..a92f7a9f21 100644
--- a/app/src/main/res/values-no/strings.xml
+++ b/app/src/main/res/values-no/strings.xml
@@ -118,6 +118,7 @@
Mark unread
Forward
Reply to all
+ Show original
Trash
Spam
Move
diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml
index 7429464f55..315e5e78a4 100644
--- a/app/src/main/res/values-pl/strings.xml
+++ b/app/src/main/res/values-pl/strings.xml
@@ -126,6 +126,7 @@
Oznacz jako nieprzeczytane
Prześlij dalej
Odpowiedz wszystkim
+ Show original
Kosz
Spam
Przenieś
diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml
index 71c2aab4c9..9a43fc5206 100644
--- a/app/src/main/res/values-pt-rBR/strings.xml
+++ b/app/src/main/res/values-pt-rBR/strings.xml
@@ -118,6 +118,7 @@
Mark unread
Encaminhar
Responder a todos
+ Show original
Lixeira
Spam
Mover
diff --git a/app/src/main/res/values-pt-rPT/strings.xml b/app/src/main/res/values-pt-rPT/strings.xml
index 5b63fc95b6..a92f7a9f21 100644
--- a/app/src/main/res/values-pt-rPT/strings.xml
+++ b/app/src/main/res/values-pt-rPT/strings.xml
@@ -118,6 +118,7 @@
Mark unread
Forward
Reply to all
+ Show original
Trash
Spam
Move
diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml
index 92472bb7d3..982c4afa1b 100644
--- a/app/src/main/res/values-ro/strings.xml
+++ b/app/src/main/res/values-ro/strings.xml
@@ -122,6 +122,7 @@
Marcare ca necitit
Redirecționează
Răspunde tuturor
+ Show original
Gunoi
Spam
Mută
diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml
index e924d4a22f..9d6a0c5882 100644
--- a/app/src/main/res/values-ru/strings.xml
+++ b/app/src/main/res/values-ru/strings.xml
@@ -126,6 +126,7 @@
Mark unread
Forward
Reply to all
+ Show original
Trash
Spam
Move
diff --git a/app/src/main/res/values-sr/strings.xml b/app/src/main/res/values-sr/strings.xml
index 4a26319f2b..36023cae11 100644
--- a/app/src/main/res/values-sr/strings.xml
+++ b/app/src/main/res/values-sr/strings.xml
@@ -122,6 +122,7 @@
Mark unread
Forward
Reply to all
+ Show original
Trash
Spam
Move
diff --git a/app/src/main/res/values-sv-rSE/strings.xml b/app/src/main/res/values-sv-rSE/strings.xml
index 5b63fc95b6..a92f7a9f21 100644
--- a/app/src/main/res/values-sv-rSE/strings.xml
+++ b/app/src/main/res/values-sv-rSE/strings.xml
@@ -118,6 +118,7 @@
Mark unread
Forward
Reply to all
+ Show original
Trash
Spam
Move
diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml
index 060be353a5..9c6753d775 100644
--- a/app/src/main/res/values-tr/strings.xml
+++ b/app/src/main/res/values-tr/strings.xml
@@ -118,6 +118,7 @@
Okunmadı olarak işaretle
İlet
Tümünü yanıtla
+ Show original
Çöp Kutusu
Spam
Taşı
diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml
index e924d4a22f..9d6a0c5882 100644
--- a/app/src/main/res/values-uk/strings.xml
+++ b/app/src/main/res/values-uk/strings.xml
@@ -126,6 +126,7 @@
Mark unread
Forward
Reply to all
+ Show original
Trash
Spam
Move
diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml
index d94ccd0845..91ed306227 100644
--- a/app/src/main/res/values-vi/strings.xml
+++ b/app/src/main/res/values-vi/strings.xml
@@ -114,6 +114,7 @@
Mark unread
Forward
Reply to all
+ Show original
Trash
Spam
Move
diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml
index 4d836a0b03..f383a7b7dc 100644
--- a/app/src/main/res/values-zh-rCN/strings.xml
+++ b/app/src/main/res/values-zh-rCN/strings.xml
@@ -114,6 +114,7 @@
标记为未读
转发
回复全部
+ Show original
回收站
垃圾邮件
移动
diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml
index d94ccd0845..91ed306227 100644
--- a/app/src/main/res/values-zh-rTW/strings.xml
+++ b/app/src/main/res/values-zh-rTW/strings.xml
@@ -114,6 +114,7 @@
Mark unread
Forward
Reply to all
+ Show original
Trash
Spam
Move
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 1c8f2f1dc4..f7698f9103 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -139,6 +139,7 @@
Mark unread
Forward
Reply to all
+ Show original
Trash
Spam