Is ListView completely inferior to RecyclerView?
Asked Answered
N

2

8

So, Vogella seems to suggest that ListView is completely being deprecated in comparison with RecyclerView. And not actually deprecated, but rather that there is no situation in which ListView would be a better choice. Is this true? The commonsware book suggests that it might be faster at updating. Is there any other reason to completely avoid ListView from now on? Just reading through some examples, it seems that RecyclerView adds many layers of difficulty/convolution to the code, hence my desire to avoid using such unless there's a very good reason (animation isn't a superb-enough reason)

Noticeable answered 30/4, 2015 at 1:26 Comment(1)
Look this post Should we use RecyclerView to replace ListView?Stephanstephana
B
4

RecyclerView mechanism contains:

  1. RecyclerView: A ViewGroup or Container
  2. LayoutManager: Responsible for the layout and the arrangement of items, there are 3 built-in LayoutManagers, LinearLayoutManager, GridLayoutManager and StaggeredGridLayoutManager.
  3. ItemDecoration: Custom item decoration, for example: DividerItemDecoration
  4. ItemAnimator: Custom item animation

ListView = RecyclerView + LinearLayoutManager(Vertical).

RecyclerView mechanism can implement ListView, GridView, WaterFall... easily, and also can implement other custom views by custmom LayoutManager.

That is why we should use RecyclerView in the future.

Bannon answered 30/4, 2015 at 2:29 Comment(0)
H
0

I believe the listview will be phased out eventually, but you will always be able to use it. I use listviews in drawer layouts for example. since drawers usually dont have that many items in them to begin with, the viewholder pattern doesnt really apply. So its much simpler to use.

Hoofer answered 30/4, 2015 at 1:52 Comment(1)
The viewholder pattern is built in within the recyclerview.Ischium

© 2022 - 2024 — McMap. All rights reserved.