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