From 769e625a15ff038a801ae5326b32b3253914e578 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 23 Apr 2019 12:33:57 +0200 Subject: [PATCH] Use style to adapt WebView for dark themes --- FAQ.md | 5 ---- .../eu/faircode/email/AdapterMessage.java | 19 ++++++------- .../eu/faircode/email/FragmentOptions.java | 14 ++-------- .../main/java/eu/faircode/email/Helper.java | 7 ----- app/src/main/res/layout/fragment_options.xml | 27 +------------------ app/src/main/res/values/strings.xml | 2 -- 6 files changed, 11 insertions(+), 63 deletions(-) diff --git a/FAQ.md b/FAQ.md index d829b9df10..be8865c6cb 100644 --- a/FAQ.md +++ b/FAQ.md @@ -29,7 +29,6 @@ For authorizing: * A [bug in Android](https://issuetracker.google.com/issues/62427912) "*... ActivityRecord not found for ...*" sometimes causes a crash after updating FairEmail. * ~~A [bug in Google Drive](https://issuetracker.google.com/issues/126362828) causes files exported to Google Drive to be empty.~~ * "*... Couldn't read row ...*" causes sometimes a crash. This could be caused by a bug in the [Room Persistence Library](https://developer.android.com/topic/libraries/architecture/room) but more likely indicates a corrupt database. -* "*... Unable to create layer ...*" causes a crash on some devices when inverting the colors of an original message due to a [bug in AndroidX](https://bugs.chromium.org/p/chromium/issues/detail?id=578150) ## Planned features @@ -1393,10 +1392,6 @@ FairEmail already tries to workaround these bugs, but if this fail you'll need t ~~The original message is shown as the sender has sent it, including all colors.~~ ~~Changing the background color would not only make the original view not original anymore, it can also result in unreadable messages.~~ -Recent versions of FairEmail can invert all colors of the original message when using a dark or black theme. -You can turn this on the advanced settings. -Be aware that this can cause [crashes](https://bugs.chromium.org/p/chromium/issues/detail?id=578150) on some devices. -
diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index 9d196b4ef1..41e0976321 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -36,8 +36,6 @@ import android.content.pm.PackageManager; import android.content.res.ColorStateList; import android.database.Cursor; import android.graphics.Color; -import android.graphics.ColorMatrixColorFilter; -import android.graphics.Paint; import android.graphics.Rect; import android.graphics.Typeface; import android.graphics.drawable.Drawable; @@ -150,7 +148,6 @@ public class AdapterMessage extends RecyclerView.Adapter() { @Override protected OriginalMessage onExecute(Context context, Bundle args) throws IOException { long id = args.getLong("id"); + boolean dark = args.getBoolean("dark"); DB db = DB.getInstance(context); EntityMessage message = db.message().getMessage(id); @@ -1523,6 +1516,11 @@ public class AdapterMessage extends RecyclerView.Adapter" + + "* { background: #000000 !important; color: #FFFFFF !important }" + + "" + original.html; + Document doc = Jsoup.parse(original.html); original.has_images = (doc.select("img").size() > 0); @@ -3069,7 +3067,6 @@ public class AdapterMessage extends RecyclerView.Adapter - - - - Use monospaced font for message text Automatically show original message for known contacts Automatically show images for known contacts - Invert colors of original message when using a dark theme Conversation action bar Pull down to refresh @@ -214,7 +213,6 @@ When disabled only names will be shown when available Note that starred messages will always be kept locally Only available when message text was downloaded - Enabling this option can cause crashes Automatically open message when there is just one message or just one unread message in a conversation Multiple expanded messages will always be closed on \'back\'