I am rendering a vertical feed of WebViews using a RecyclerView. The WebViews may have different content heights, and but we need to cap the height of a WebView to be at most the height of the feed container (RecyclerView) so that any popup wouldn't go beyond the screen. This results in these WebViews being scrollable themselves.
Is it possible to build this in a way that user can scroll through this feed as if they are scrolling through the web content of individual WebViews?
I have tried subclassing RecyclerView and overriding the onScrolled
method to pass scroll amount to the currently visible WebView, if it can still be scrolled. However this approach has performance concerns (onScrolled
is called after scroll has already happened so I need to keep reversing the scroll) and functional limitations (onScrolled
is not called when user is scrolled to the top or bottom or the RecyclerView but the child WebView may still be scrollable), so it's falling short of our needs...
Any suggestions on the best way to achieve this? Thanks in advance.