KevinnZou / compose-webview

A wrapper of WebView for Jetpack Compose
https://google.github.io/accompanist/web/
Apache License 2.0
56 stars 8 forks source link

when the webview is not fully loaded, other @Composables cannot render normally #14

Open whitescent opened 2 months ago

whitescent commented 2 months ago

It seems that the other@Composables don't render properly when the webview is not fully loaded.

here's a very simple example

Column {
  val state = rememberWebViewState("https://github.com/KevinnZou/compose-webview")
  Text(text = "${state.pageTitle}")
  LinearProgressIndicator(modifier = Modifier.fillMaxWidth())
  WebView(state)
}

https://github.com/KevinnZou/compose-webview/assets/31311826/1a2351ff-b687-43fb-9d65-2e2b08d5afe6

I'm not sure what's causing this, my guess is that it might be because the AndroidView support in Compose isn't very good 🤔

KevinnZou commented 2 months ago

@whitescent Thanks for your feedback! Yes, it is a known issue caused by AndroidView. We may need to wait for an official improvement.

whitescent commented 2 months ago

👀 Has this bug been reported by anyone in issueTracker?

whitescent commented 2 months ago

oh, i've found this issue https://issuetracker.google.com/issues/314821744

whitescent commented 2 weeks ago

https://github.com/androidx/androidx/commit/d0c62435c0c00d004f73eaed66fc316179d1bba0

I just found this commit and wondered if it could be used to solve the WebView flickering issue 🤔