Browse Source

Added option to show orginal message

Fixes #64
main
M66B 6 years ago
parent
commit
4bd931c29f
41 changed files with 96 additions and 9 deletions
  1. BIN
      .idea/caches/build_file_checksums.ser
  2. +27
    -1
      app/src/main/java/eu/faircode/email/FragmentMessage.java
  3. +26
    -8
      app/src/main/java/eu/faircode/email/FragmentWebView.java
  4. +6
    -0
      app/src/main/res/menu/menu_view.xml
  5. +1
    -0
      app/src/main/res/values-af/strings.xml
  6. +1
    -0
      app/src/main/res/values-ar-rBH/strings.xml
  7. +1
    -0
      app/src/main/res/values-ar-rEG/strings.xml
  8. +1
    -0
      app/src/main/res/values-ar-rSA/strings.xml
  9. +1
    -0
      app/src/main/res/values-ar-rYE/strings.xml
  10. +1
    -0
      app/src/main/res/values-ar/strings.xml
  11. +1
    -0
      app/src/main/res/values-ca/strings.xml
  12. +1
    -0
      app/src/main/res/values-cs/strings.xml
  13. +1
    -0
      app/src/main/res/values-da/strings.xml
  14. +1
    -0
      app/src/main/res/values-de/strings.xml
  15. +1
    -0
      app/src/main/res/values-el/strings.xml
  16. +1
    -0
      app/src/main/res/values-en/strings.xml
  17. +1
    -0
      app/src/main/res/values-es-rES/strings.xml
  18. +1
    -0
      app/src/main/res/values-fi/strings.xml
  19. +1
    -0
      app/src/main/res/values-fr/strings.xml
  20. +1
    -0
      app/src/main/res/values-he/strings.xml
  21. +1
    -0
      app/src/main/res/values-hu/strings.xml
  22. +1
    -0
      app/src/main/res/values-it/strings.xml
  23. +1
    -0
      app/src/main/res/values-iw/strings.xml
  24. +1
    -0
      app/src/main/res/values-ja/strings.xml
  25. +1
    -0
      app/src/main/res/values-ko/strings.xml
  26. +1
    -0
      app/src/main/res/values-nb/strings.xml
  27. +1
    -0
      app/src/main/res/values-nl/strings.xml
  28. +1
    -0
      app/src/main/res/values-no/strings.xml
  29. +1
    -0
      app/src/main/res/values-pl/strings.xml
  30. +1
    -0
      app/src/main/res/values-pt-rBR/strings.xml
  31. +1
    -0
      app/src/main/res/values-pt-rPT/strings.xml
  32. +1
    -0
      app/src/main/res/values-ro/strings.xml
  33. +1
    -0
      app/src/main/res/values-ru/strings.xml
  34. +1
    -0
      app/src/main/res/values-sr/strings.xml
  35. +1
    -0
      app/src/main/res/values-sv-rSE/strings.xml
  36. +1
    -0
      app/src/main/res/values-tr/strings.xml
  37. +1
    -0
      app/src/main/res/values-uk/strings.xml
  38. +1
    -0
      app/src/main/res/values-vi/strings.xml
  39. +1
    -0
      app/src/main/res/values-zh-rCN/strings.xml
  40. +1
    -0
      app/src/main/res/values-zh-rTW/strings.xml
  41. +1
    -0
      app/src/main/res/values/strings.xml

BIN
.idea/caches/build_file_checksums.ser View File


+ 27
- 1
app/src/main/java/eu/faircode/email/FragmentMessage.java View File

@ -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<String>() {
@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<List<EntityAnswer>>() {
@Override


+ 26
- 8
app/src/main/java/eu/faircode/email/FragmentWebView.java View File

@ -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;
}


+ 6
- 0
app/src/main/res/menu/menu_view.xml View File

@ -26,6 +26,12 @@
android:title="@string/title_reply_all"
app:showAsAction="never" />
<item
android:id="@+id/menu_show_html"
android:icon="@drawable/baseline_visibility_24"
android:title="@string/title_show_html"
app:showAsAction="never" />
<item
android:id="@+id/menu_answer"
android:icon="@drawable/baseline_reply_24"


+ 1
- 0
app/src/main/res/values-af/strings.xml View File

@ -118,6 +118,7 @@
<string name="title_unseen">Mark unread</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Trash</string>
<string name="title_spam">Spam</string>
<string name="title_move">Move</string>


+ 1
- 0
app/src/main/res/values-ar-rBH/strings.xml View File

@ -134,6 +134,7 @@
<string name="title_unseen">Mark unread</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Trash</string>
<string name="title_spam">Spam</string>
<string name="title_move">Move</string>


+ 1
- 0
app/src/main/res/values-ar-rEG/strings.xml View File

@ -134,6 +134,7 @@
<string name="title_unseen">Mark unread</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Trash</string>
<string name="title_spam">Spam</string>
<string name="title_move">Move</string>


+ 1
- 0
app/src/main/res/values-ar-rSA/strings.xml View File

@ -134,6 +134,7 @@
<string name="title_unseen">Mark unread</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Trash</string>
<string name="title_spam">Spam</string>
<string name="title_move">Move</string>


+ 1
- 0
app/src/main/res/values-ar-rYE/strings.xml View File

@ -134,6 +134,7 @@
<string name="title_unseen">Mark unread</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Trash</string>
<string name="title_spam">Spam</string>
<string name="title_move">Move</string>


+ 1
- 0
app/src/main/res/values-ar/strings.xml View File

@ -134,6 +134,7 @@
<string name="title_unseen">Mark unread</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Trash</string>
<string name="title_spam">Spam</string>
<string name="title_move">Move</string>


+ 1
- 0
app/src/main/res/values-ca/strings.xml View File

@ -118,6 +118,7 @@
<string name="title_unseen">Mark unread</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Trash</string>
<string name="title_spam">Spam</string>
<string name="title_move">Move</string>


+ 1
- 0
app/src/main/res/values-cs/strings.xml View File

@ -126,6 +126,7 @@
<string name="title_unseen">Mark unread</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Trash</string>
<string name="title_spam">Spam</string>
<string name="title_move">Move</string>


+ 1
- 0
app/src/main/res/values-da/strings.xml View File

@ -118,6 +118,7 @@
<string name="title_unseen">Markér som ulæst</string>
<string name="title_forward">Videresend</string>
<string name="title_reply_all">Svar alle</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Papirkurv</string>
<string name="title_spam">Spam</string>
<string name="title_move">Flyt</string>


+ 1
- 0
app/src/main/res/values-de/strings.xml View File

@ -118,6 +118,7 @@
<string name="title_unseen">Als ungelesen markieren</string>
<string name="title_forward">Weiterleiten</string>
<string name="title_reply_all">Antworten an alle</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Papierkorb</string>
<string name="title_spam">Spam</string>
<string name="title_move">Verschieben</string>


+ 1
- 0
app/src/main/res/values-el/strings.xml View File

@ -118,6 +118,7 @@
<string name="title_unseen">Mark unread</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Trash</string>
<string name="title_spam">Spam</string>
<string name="title_move">Move</string>


+ 1
- 0
app/src/main/res/values-en/strings.xml View File

@ -118,6 +118,7 @@
<string name="title_unseen">Mark unread</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Trash</string>
<string name="title_spam">Spam</string>
<string name="title_move">Move</string>


+ 1
- 0
app/src/main/res/values-es-rES/strings.xml View File

@ -118,6 +118,7 @@
<string name="title_unseen">Mark unread</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Trash</string>
<string name="title_spam">Spam</string>
<string name="title_move">Move</string>


+ 1
- 0
app/src/main/res/values-fi/strings.xml View File

@ -118,6 +118,7 @@
<string name="title_unseen">Mark unread</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Trash</string>
<string name="title_spam">Spam</string>
<string name="title_move">Move</string>


+ 1
- 0
app/src/main/res/values-fr/strings.xml View File

@ -118,6 +118,7 @@
<string name="title_unseen">Marquer comme non lu</string>
<string name="title_forward">Transférer</string>
<string name="title_reply_all">Répondre à tous</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Corbeille</string>
<string name="title_spam">Spam</string>
<string name="title_move">Déplacer</string>


+ 1
- 0
app/src/main/res/values-he/strings.xml View File

@ -126,6 +126,7 @@
<string name="title_unseen">Mark unread</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Trash</string>
<string name="title_spam">Spam</string>
<string name="title_move">Move</string>


+ 1
- 0
app/src/main/res/values-hu/strings.xml View File

@ -118,6 +118,7 @@
<string name="title_unseen">Mark unread</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Trash</string>
<string name="title_spam">Spam</string>
<string name="title_move">Move</string>


+ 1
- 0
app/src/main/res/values-it/strings.xml View File

@ -118,6 +118,7 @@
<string name="title_unseen">Segna come non letto</string>
<string name="title_forward">Inoltra</string>
<string name="title_reply_all">Rispondi a tutti</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Cestino</string>
<string name="title_spam">Posta indesiderata</string>
<string name="title_move">Sposta</string>


+ 1
- 0
app/src/main/res/values-iw/strings.xml View File

@ -126,6 +126,7 @@
<string name="title_unseen">Mark unread</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Trash</string>
<string name="title_spam">Spam</string>
<string name="title_move">Move</string>


+ 1
- 0
app/src/main/res/values-ja/strings.xml View File

@ -114,6 +114,7 @@
<string name="title_unseen">Mark unread</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Trash</string>
<string name="title_spam">Spam</string>
<string name="title_move">Move</string>


+ 1
- 0
app/src/main/res/values-ko/strings.xml View File

@ -114,6 +114,7 @@
<string name="title_unseen">Mark unread</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Trash</string>
<string name="title_spam">Spam</string>
<string name="title_move">Move</string>


+ 1
- 0
app/src/main/res/values-nb/strings.xml View File

@ -118,6 +118,7 @@
<string name="title_unseen">Mark unread</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Trash</string>
<string name="title_spam">Spam</string>
<string name="title_move">Move</string>


+ 1
- 0
app/src/main/res/values-nl/strings.xml View File

@ -118,6 +118,7 @@
<string name="title_unseen">Mark unread</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Trash</string>
<string name="title_spam">Spam</string>
<string name="title_move">Move</string>


+ 1
- 0
app/src/main/res/values-no/strings.xml View File

@ -118,6 +118,7 @@
<string name="title_unseen">Mark unread</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Trash</string>
<string name="title_spam">Spam</string>
<string name="title_move">Move</string>


+ 1
- 0
app/src/main/res/values-pl/strings.xml View File

@ -126,6 +126,7 @@
<string name="title_unseen">Oznacz jako nieprzeczytane</string>
<string name="title_forward">Prześlij dalej</string>
<string name="title_reply_all">Odpowiedz wszystkim</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Kosz</string>
<string name="title_spam">Spam</string>
<string name="title_move">Przenieś</string>


+ 1
- 0
app/src/main/res/values-pt-rBR/strings.xml View File

@ -118,6 +118,7 @@
<string name="title_unseen">Mark unread</string>
<string name="title_forward">Encaminhar</string>
<string name="title_reply_all">Responder a todos</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Lixeira</string>
<string name="title_spam">Spam</string>
<string name="title_move">Mover</string>


+ 1
- 0
app/src/main/res/values-pt-rPT/strings.xml View File

@ -118,6 +118,7 @@
<string name="title_unseen">Mark unread</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Trash</string>
<string name="title_spam">Spam</string>
<string name="title_move">Move</string>


+ 1
- 0
app/src/main/res/values-ro/strings.xml View File

@ -122,6 +122,7 @@
<string name="title_unseen">Marcare ca necitit</string>
<string name="title_forward">Redirecționează</string>
<string name="title_reply_all">Răspunde tuturor</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Gunoi</string>
<string name="title_spam">Spam</string>
<string name="title_move">Mută</string>


+ 1
- 0
app/src/main/res/values-ru/strings.xml View File

@ -126,6 +126,7 @@
<string name="title_unseen">Mark unread</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Trash</string>
<string name="title_spam">Spam</string>
<string name="title_move">Move</string>


+ 1
- 0
app/src/main/res/values-sr/strings.xml View File

@ -122,6 +122,7 @@
<string name="title_unseen">Mark unread</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Trash</string>
<string name="title_spam">Spam</string>
<string name="title_move">Move</string>


+ 1
- 0
app/src/main/res/values-sv-rSE/strings.xml View File

@ -118,6 +118,7 @@
<string name="title_unseen">Mark unread</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Trash</string>
<string name="title_spam">Spam</string>
<string name="title_move">Move</string>


+ 1
- 0
app/src/main/res/values-tr/strings.xml View File

@ -118,6 +118,7 @@
<string name="title_unseen">Okunmadı olarak işaretle</string>
<string name="title_forward">İlet</string>
<string name="title_reply_all">Tümünü yanıtla</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Çöp Kutusu</string>
<string name="title_spam">Spam</string>
<string name="title_move">Taşı</string>


+ 1
- 0
app/src/main/res/values-uk/strings.xml View File

@ -126,6 +126,7 @@
<string name="title_unseen">Mark unread</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Trash</string>
<string name="title_spam">Spam</string>
<string name="title_move">Move</string>


+ 1
- 0
app/src/main/res/values-vi/strings.xml View File

@ -114,6 +114,7 @@
<string name="title_unseen">Mark unread</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Trash</string>
<string name="title_spam">Spam</string>
<string name="title_move">Move</string>


+ 1
- 0
app/src/main/res/values-zh-rCN/strings.xml View File

@ -114,6 +114,7 @@
<string name="title_unseen">标记为未读</string>
<string name="title_forward">转发</string>
<string name="title_reply_all">回复全部</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">回收站</string>
<string name="title_spam">垃圾邮件</string>
<string name="title_move">移动</string>


+ 1
- 0
app/src/main/res/values-zh-rTW/strings.xml View File

@ -114,6 +114,7 @@
<string name="title_unseen">Mark unread</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Trash</string>
<string name="title_spam">Spam</string>
<string name="title_move">Move</string>


+ 1
- 0
app/src/main/res/values/strings.xml View File

@ -139,6 +139,7 @@
<string name="title_unseen">Mark unread</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_html">Show original</string>
<string name="title_trash">Trash</string>
<string name="title_spam">Spam</string>


Loading…
Cancel
Save