Hello, I've a question related to webview performa...
# android
h
Hello, I've a question related to webview performance. In Webview loading of sites is very slow and some contents shows not properly.  What mistake did I make?  Thanks in advance.
Copy code
private fun webViewSettings(url: String) {

    activityWebBinding.webView.settings.apply {
        javaScriptEnabled = true
        domStorageEnabled = true
        builtInZoomControls = true
        displayZoomControls = false
        javaScriptCanOpenWindowsAutomatically = true
        cacheMode = WebSettings.LOAD_DEFAULT
        setAppCachePath(applicationContext.cacheDir.absolutePath)

        defaultZoom = WebSettings.ZoomDensity.FAR
        loadWithOverviewMode = true
        useWideViewPort = true
        allowFileAccess = true
        allowContentAccess = true
        setSupportZoom(true)
        layoutAlgorithm = WebSettings.LayoutAlgorithm.SINGLE_COLUMN

        setRenderPriority(WebSettings.RenderPriority.HIGH)
        mixedContentMode = WebSettings.MIXED_CONTENT_ALWAYS_ALLOW

        setSupportMultipleWindows(true)
    }

    activityWebBinding.webView.apply {
        if (Build.VERSION.SDK_INT >= 22) {
            setLayerType(View.LAYER_TYPE_HARDWARE, null)
        } else {
            setLayerType(View.LAYER_TYPE_SOFTWARE, null)
        }
        scrollBarStyle = View.SCROLLBARS_INSIDE_OVERLAY
        isScrollbarFadingEnabled = true
        setBackgroundColor(Color.TRANSPARENT)
        loadUrl(url)
    }
}
🧵 3
😶 2
s
It's slow by design...