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 {