I'm trying to display an article with paragraphs, images, quotes, etc. My backend currently returns an article as a list of paragraphs, images, etc. but this can be changed if needed.
I tried the following :
Using a
WebView
and loading the whole article. Works fine butWebViews
are very consuming and I can't customize content appearance as I would like to.Using a
ScrollView
and populating it withTextViews
for each paragraph andImageViews
for each image. Works OK but is very laggy at the beginning while populating theScrollView
Using a
ListView
(and later aRecyclerView
) to benefit from recycling. The problem with this solution is that some items may be quite long (ie : a long paragraphe) and it can be laggy when a long item appears on screen while scrolling.
None of the solutions above seems to be optimal, so I wonder : what's the best way to display an article?
Thanks for your answers
Edit 2: All the solutions above work, my question is not about how to make it work but about how to make it as optimized and smooth as possible.
Edit: This is the kind of things I'm trying to display.