From 8032a3e1d8b4983a59561bc6126746175f9002aa Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 29 Sep 2021 11:48:28 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=85=E8=AF=BB=E7=95=8C=E9=9D=A2=E5=AF=BC?= =?UTF-8?q?=E8=88=AA=E6=A0=8F=E4=B8=8D=E5=86=8D=E9=80=8F=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/assets/updateLog.md | 5 +++++ .../io/legado/app/help/http/HttpHelper.kt | 13 ------------ .../app/model/analyzeRule/AnalyzeUrl.kt | 6 ++++-- .../io/legado/app/utils/ActivityExtensions.kt | 20 +++++++------------ 4 files changed, 16 insertions(+), 28 deletions(-) diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index 4f6d3f8bf..d886f55e5 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -12,6 +12,11 @@ * 漫画源看书显示乱码,**阅读与其他软件的源并不通用**,请导入阅读的支持的漫画源! * 关于最近版本有时候界面没有数据的问题是因为把LiveData组件换成了谷歌推荐的Flow组件导致的问题,正在查找解决办法 +**2021/09/29** + +1. 修复阅读界面导航栏挡住内容的bug +2. 修复webView=ture是自动跳转移动网站的bug + **2021/09/28** 1. 添加横屏双页模式 diff --git a/app/src/main/java/io/legado/app/help/http/HttpHelper.kt b/app/src/main/java/io/legado/app/help/http/HttpHelper.kt index 15f94e8bb..533d62a6a 100644 --- a/app/src/main/java/io/legado/app/help/http/HttpHelper.kt +++ b/app/src/main/java/io/legado/app/help/http/HttpHelper.kt @@ -92,17 +92,4 @@ fun getProxyClient(proxy: String? = null): OkHttpClient { return proxyClient } return okHttpClient -} - -suspend fun getWebViewSrc( - url: String? = null, - html: String? = null, - encode: String? = null, - tag: String? = null, - headerMap: Map? = null, - sourceRegex: String? = null, - javaScript: String? = null, -): StrResponse { - return BackstageWebView(url, html, encode, tag, headerMap, sourceRegex, javaScript) - .getStrResponse() } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt index 0387f89db..6f13b1c8e 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt @@ -346,14 +346,16 @@ class AnalyzeUrl( html = body, tag = source?.getKey(), javaScript = webJs ?: jsStr, - sourceRegex = sourceRegex + sourceRegex = sourceRegex, + headerMap = headerMap ).getStrResponse() } else -> BackstageWebView( url = url, tag = source?.getKey(), javaScript = webJs ?: jsStr, - sourceRegex = sourceRegex + sourceRegex = sourceRegex, + headerMap = headerMap ).getStrResponse() } } diff --git a/app/src/main/java/io/legado/app/utils/ActivityExtensions.kt b/app/src/main/java/io/legado/app/utils/ActivityExtensions.kt index a1d9e02a4..2fe4b5425 100644 --- a/app/src/main/java/io/legado/app/utils/ActivityExtensions.kt +++ b/app/src/main/java/io/legado/app/utils/ActivityExtensions.kt @@ -32,19 +32,13 @@ val Activity.windowSize: DisplayMetrics */ val Activity.isNavigationBarExist: Boolean get() { - val viewGroup = window.decorView as? ViewGroup - if (viewGroup != null) { - for (i in 0 until viewGroup.childCount) { - viewGroup.getChildAt(i).context.packageName - if (viewGroup.getChildAt(i).id != View.NO_ID - && "navigationBarBackground" == resources.getResourceEntryName( - viewGroup.getChildAt( - i - ).id - ) - ) { - return true - } + val viewGroup = (window.decorView as? ViewGroup) ?: return false + for (i in 0 until viewGroup.childCount) { + val childId = viewGroup.getChildAt(i).id + if (childId != View.NO_ID + && resources.getResourceEntryName(childId) == "navigationBarBackground" + ) { + return true } } return false