Zuhayr Zuhayr -4 years ago 171
Android Question

RecyclerView vs ListView for a chat application

Which is better to use to display chat messages? As far as I understand, RecyclerView supports more custom view orientations (and is generally seen to be superior performance-wise), but since chat is inherently list-like, would it be better to use ListView?

Does it make much of a difference either way for this use-case?

Thanks!

Answer Source

RecyclerView was written as a ListView improvement, so yes, you can create a list with ListView control, but using RecyclerView is easier as it:

Reuses cells while scrolling - It implements View Holder in the listView adapter, but it was an optional thing, while in the RecycleView it's the default way of writing adapter.

Animates common list actions - Animations are decoupled and delegated to ItemAnimator.

RecyclerView is powerful when you need to customize your list or you want better animations. Those convenience methods in ListView caused a lot of trouble to people which is why RecyclerView provides a more flexible solution to them.

The RecyclerView gives huge power to its developers at the cost of increasing the complexity for the developers. There are certain things which could be done easily in a ListView can now take a lot of unnecessary effort.

I think, if ListView fulfills satisfies all use-cases then there is no need to replace it with a RecyclerView.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download