From db1a36139239e83b9dc35d2c5faae307ba2c7f61 Mon Sep 17 00:00:00 2001 From: gedoor Date: Fri, 1 Oct 2021 09:53:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/constant/AppConst.kt | 7 ------- app/src/main/java/io/legado/app/constant/Theme.kt | 3 ++- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/io/legado/app/constant/AppConst.kt b/app/src/main/java/io/legado/app/constant/AppConst.kt index 5d4386875..83032ceb4 100644 --- a/app/src/main/java/io/legado/app/constant/AppConst.kt +++ b/app/src/main/java/io/legado/app/constant/AppConst.kt @@ -78,13 +78,6 @@ object AppConst { val sysElevation = appCtx.resources.getDimension(R.dimen.design_appbar_elevation).toInt() - val darkWebViewJs by lazy { - """ - document.body.style.backgroundColor = "#222222"; - document.getElementsByTagName('body')[0].style.webkitTextFillColor = '#8a8a8a'; - """.trimIndent() - } - val androidId: String by lazy { Settings.System.getString(appCtx.contentResolver, Settings.Secure.ANDROID_ID) } diff --git a/app/src/main/java/io/legado/app/constant/Theme.kt b/app/src/main/java/io/legado/app/constant/Theme.kt index 8145f4d01..f83474b69 100644 --- a/app/src/main/java/io/legado/app/constant/Theme.kt +++ b/app/src/main/java/io/legado/app/constant/Theme.kt @@ -13,7 +13,8 @@ enum class Theme { else -> Light } - fun getTheme(backgroundColor: Int) = + @Suppress("unused") + fun fromBackground(backgroundColor: Int) = if (ColorUtils.isColorLight(backgroundColor)) Light else Dark