1

I want to disable the text selection in android webview and am using Jetpack compose

AndroidView(factory = {
                WebView(it).apply {
                    layoutParams = ViewGroup.LayoutParams(
                        ViewGroup.LayoutParams.MATCH_PARENT,
                        ViewGroup.LayoutParams.MATCH_PARENT
                    )
                    this.isLongClickable = false
                    webViewClient = WebViewClient()
                    settings.javaScriptEnabled = true
                    webViewClient = object: WebViewClient(){
                        override fun onPageStarted(
                            view: WebView, url: String,
                            favicon: Bitmap?) {
                            onShowProgressBar.invoke()
                        }

                        override fun onPageFinished(
                            view: WebView, url: String) {
                            onShowProgressBar.invoke()
                        }
                    }

                    loadUrl(url)
                }
            }, update = {
                it.loadUrl(url)
            })

Note: I tried with isLongClickable = false still its not working

Tippu Fisal Sheriff
  • 2,177
  • 11
  • 19

0 Answers0