From 330ecbe434fa4b1375d581e46439e0c06ea9eeb3 Mon Sep 17 00:00:00 2001 From: Fahim Salam Chowdhury Date: Fri, 3 Feb 2023 19:11:49 +0600 Subject: [PATCH 1/2] 6037-Fix_webview_darkmode_color_issue issue: https://gitlab.e.foundation/e/backlog/-/issues/6037 To setup dark mode, previously css pushed manually, it causes some images not getting visible perfectly in the dark-mode (because of force background color set). This commit replace the css push with android webkit dark-mode support. --- .../java/com/fsck/k9/message/html/DisplayHtml.kt | 2 -- app/k9mail/src/main/res/values/themes.xml | 1 + app/ui/legacy/build.gradle | 1 + .../main/java/com/fsck/k9/view/MessageWebView.kt | 15 +++++++++++++++ gradle/libs.versions.toml | 1 + 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/core/src/main/java/com/fsck/k9/message/html/DisplayHtml.kt b/app/core/src/main/java/com/fsck/k9/message/html/DisplayHtml.kt index 9c009648a9..9034f4d2ca 100644 --- a/app/core/src/main/java/com/fsck/k9/message/html/DisplayHtml.kt +++ b/app/core/src/main/java/com/fsck/k9/message/html/DisplayHtml.kt @@ -6,7 +6,6 @@ class DisplayHtml(private val settings: HtmlSettings) : HtmlHeadProvider { override val headHtml: String get() { return """""" + - cssStyleTheme() + cssStylePre() + cssStyleSignature() } @@ -18,7 +17,6 @@ class DisplayHtml(private val settings: HtmlSettings) : HtmlHeadProvider { fun wrapMessageContent(messageContent: CharSequence): String { // Include a meta tag so the WebView will not use a fixed viewport width of 980 px return "" + - cssStyleTheme() + cssStylePre() + "" + messageContent + diff --git a/app/k9mail/src/main/res/values/themes.xml b/app/k9mail/src/main/res/values/themes.xml index abd4094b01..98833ebb6b 100644 --- a/app/k9mail/src/main/res/values/themes.xml +++ b/app/k9mail/src/main/res/values/themes.xml @@ -26,6 +26,7 @@