I have a RecyclerView using the LinearLayoutManager where each of the child cards contains a WebView. I load the data into the WebView using the loadData() method. Things work fine when I'm scrolling down the list, but when I scroll down far enough that the above views get recycled I get issues when I scroll back up.
When the RecyclerView reattaches the above child it reloads the data in the WebView, but it doesn't reload it until the WebView is on the screen. When the WebView loads its data, it pushes all the children below it down the screen. So instead of having the bottom of the WebView slowly appear on screen as I scroll up, the entire WebView jumps on to the screen at the top of the WebView. It's very jarring and not smooth at all.
Is there any way to tell the adapter or layout manager to load the WebViews ahead of time? I'd be happy with my app if the RecyclerView scrolled smoothly, but right now it's pretty much unusable any time I scroll back up.
Try Resizing WebView to Match the Content Size
Also might want to look at, Recycler View – pre cache views
In combo it works pretty good but I'm still trying to improve scrolling.
I know this is an old question, but stumbled upon it when researching another answer. Try to set the item view cache size higher.
RecyclerView.setItemViewCacheSize(int cacheSize)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With