From d8dc372c37816b96150c3a90bc19989b33e51c17 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 4 May 2019 12:49:25 +0200 Subject: [PATCH] State fixes --- .../eu/faircode/email/AdapterMessage.java | 31 ++++++++++++------- .../eu/faircode/email/FragmentMessages.java | 3 +- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index dea1e32b79..21d44507cf 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -746,6 +746,7 @@ public class AdapterMessage extends RecyclerView.Adapter 0 ? View.INVISIBLE : View.GONE); // For performance reasons the WebView is created when needed only @@ -1446,6 +1448,7 @@ public class AdapterMessage extends RecyclerView.Adapter 0); + + ibImages.setVisibility(has_images && !show_images ? View.VISIBLE : View.GONE); ibFull.setVisibility(View.VISIBLE); - ibImages.setVisibility(show_images ? View.GONE : View.VISIBLE); webView.loadDataWithBaseURL("about:blank", themeHtml(html), "text/html", "UTF-8", null); + webView.setVisibility(View.VISIBLE); pbBody.setVisibility(View.GONE); - tvBody.setVisibility(View.GONE); - webView.setVisibility(View.VISIBLE); } } private void onHideHtml(TupleMessageEx message) { properties.setValue("html", message.id, false); - ibImages.setVisibility(View.INVISIBLE); ibFull.setVisibility(View.GONE); - - tvBody.setVisibility(View.INVISIBLE); vwBody.setVisibility(View.GONE); + Spanned body = properties.getBody(message.id); + tvBody.setText(body); + tvBody.setMovementMethod(null); + tvBody.setVisibility(View.VISIBLE); + showText(message); } @@ -1804,12 +1809,14 @@ public class AdapterMessage extends RecyclerView.Adapter 0 ? View.VISIBLE : View.GONE); } diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 50e1c37bb5..597dd4fadf 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -706,7 +706,8 @@ public class FragmentMessages extends FragmentBase { if (!values.containsKey(name)) values.put(name, new ArrayList()); if (enabled) { - values.get(name).add(id); + if (!values.get(name).contains(id)) + values.get(name).add(id); if ("expanded".equals(name)) handleExpand(id); } else