Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is ListView completely inferior to RecyclerView?

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)

like image 417
squirrelsareduck Avatar asked Apr 30 '15 01:04

squirrelsareduck


1 Answers

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.

like image 138
Will Mo Avatar answered Oct 01 '22 09:10

Will Mo