Is it possible to use webView in compose without u...
# compose
a
Is it possible to use webView in compose without using AndroidView?
🚫 3
In compose, I want to completely eliminate view classes. I couldn't find a library in Compose that corresponds to WebView. My aim is to completely rid of AndroidView. Is there a solution for this? From what I've researched, Compose doesn't currently support this.
s
And probably will not. There is no benefit rewriting WebView to Compose. WebView is a complex component that allows to display web pages inside app, using the native browser engine. It has many features and settings that are not easily compatible with the declarative and reactive paradigm of Compose. For example, load URLs, execute JavaScript, and interact with the web content. Trying to create something like WebView just for Compose would be extremely difficult and not very practical. It would mean making a whole new web browser engine just for Compose, which would be a huge task and not worth the effort.
thank you frog 2
j
Accompanist had webview, but they used AndroidView under the hood. And in Compose, under the hood everything ends up in Zygote and some kind of View before COmpose layer in Android. What I would focus on instead, how to get rid of webviews, thats the main problem I think. Also WebView was complex in old Android views in the past as well. Interesting here with Compose multiplatform can run Compose in web instead, like wasm or such.
thank you frog 1
s
Getting rid of WebViews is always a good solution, but it's not always possible. Sometimes, they are just required.
j
Its always possible, but not always suitable for everyone in terms of time and money 😛