Has anyone figured out how to have a compose webview with pull to refresh yet? I keep getting this request from my PMs, but can't get it to work reliably.
It's basically still this same issue: https://github.com/google/accompanist/issues/1670 I tried forking webview and making some changes, but wasn't able to get it working reliably. Surely someone is in the same boat (i.e. working on a compose app that uses webview extensively)
h
Hristijan
07/30/2024, 10:09 PM
I can't even get pull to refresh to work with predictive back navigation as it steals it's touches 🫠but this with the WebView, drove me nuts and I gave up so I made peace with a solution that wrapped the WebView in a separate box and in another box that holds these I've added the pull to refresh
c
Colton Idle
07/31/2024, 1:26 AM
So you just have a doubly nested webview inside of Boxes and you were able to get this to work? No way.
If your able to share any code I'd be eternally grateful. lol
j
Joel Denke
07/31/2024, 9:20 AM
Same issue as in regular Views, Webview using AbsoluteLayout and not honor scroll interfaces. Often solved with NestedScrollView + magic with layout params. In compose there is https://developer.android.com/develop/ui/compose/touch-input/pointer-input/scroll#nested_scrolling_interop
Also Accompanist webview is deprecated so it will not be solved. I backported their webview implementation to handle view states correct as they did not. I hope I not need pull refresh here.
Another solution is Box with scroll and put standalone pull refresh indicator component outside.
☝️ 1
c
Colton Idle
07/31/2024, 1:16 PM
yeah im using the webview fork https://github.com/KevinnZou/compose-webview
and im fine with making some modifications to it. because i have a very particular use case (have a compose app that is 90% a webview) but we require pull to refresh
i
Ian Lake
07/31/2024, 4:46 PM
Yep, WebView doesn't support nested scrolling at all, so none of the things that work by default on every other scrolling container work on WebView 😢
😭 1
c
Colton Idle
07/31/2024, 7:04 PM
darn. i could have sworn i did this in view land 🤷
guess im going to keep hacking away at this until something works lol. thanks all!