From d52ea2be608939a6f09b1180130a447e0a66d7b1 Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 7 Mar 2022 19:38:44 +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 --- .../io/legado/app/ui/login/WebViewLoginFragment.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/login/WebViewLoginFragment.kt b/app/src/main/java/io/legado/app/ui/login/WebViewLoginFragment.kt index f10701ea3..8d4d8ea9c 100644 --- a/app/src/main/java/io/legado/app/ui/login/WebViewLoginFragment.kt +++ b/app/src/main/java/io/legado/app/ui/login/WebViewLoginFragment.kt @@ -54,12 +54,12 @@ class WebViewLoginFragment : BaseFragment(R.layout.fragment_web_view_login) { @SuppressLint("SetJavaScriptEnabled") private fun initWebView(source: BaseSource) { - val settings = binding.webView.settings - settings.setSupportZoom(true) - settings.builtInZoomControls = true - settings.javaScriptEnabled = true - source.getHeaderMap()[AppConst.UA_NAME]?.let { - settings.userAgentString = it + binding.webView.settings.apply { + builtInZoomControls = true + javaScriptEnabled = true + source.getHeaderMap()[AppConst.UA_NAME]?.let { + userAgentString = it + } } val cookieManager = CookieManager.getInstance() source.loginUrl?.let {