Mjahangiry75
03/16/2021, 1:24 PMWebView
inside an AndroidView
and it's so heavy, while it works smoothly in traditional way
see the code in threadMjahangiry75
03/16/2021, 1:24 PMAndroidView(
factory = { context ->
LinearLayout(context).apply {
layoutParams = LayoutParams(MATCH_PARENT, MATCH_PARENT)
val webView = WebView(context).apply {
layoutParams = LayoutParams(MATCH_PARENT, MATCH_PARENT)
webChromeClient = WebChromeClient()
settings.javaScriptEnabled = true
addJavascriptInterface(JavaScriptInterface(context), "interface")
loadUrl("file:///android_asset/editor.html")
}
addView(
webView
)
}
}
)
aiidziis
03/16/2021, 1:25 PMMjahangiry75
03/16/2021, 1:25 PMaiidziis
03/16/2021, 1:27 PMAndroidView(factory = ::WebView, modifier = Modifier.fillMaxSize())
aiidziis
03/16/2021, 1:29 PMMjahangiry75
03/16/2021, 1:31 PMMjahangiry75
03/16/2021, 2:07 PM