The RecyclerView widget is a more flexible and advanced version of ListView . This widget is a container for displaying large data sets that can be moved very efficiently by maintaining a limited number of views. Use the widget RecyclerView when you have datasets whose elements change at runtime based on user action or network events.
The RecyclerView class simplifies the screen and manipulation of large sets of data by providing the following:
- Design managers for the positioning of elements.
- Default animations for common operations with elements, such as removing or adding elements.
You also have the flexibility to define custom design managers and animations for widgets RecyclerView .
Taken from the Android documentation
The RecyclerView class simplifies the screen and manipulation of large sets of data by providing the following:
Design managers for positioning elements
Default animations for common operations with elements, such as removing or adding elements
You also have the flexibility to define custom design managers and animations for RecyclerView widgets.
RecyclerView was created as an improvement of ListView , so yes, you can create an attached list with control ListView , but use RecyclerView is easier because:
-
Reuse the cells while moving up / down; this is possible by implementing View Holder in the listView adapter, but
it was an optional thing, while in RecycleView it's the way
default to write the adapter.
-
Decouples the list from its container, so you can easily list items at run time in the different
containers (linearLayout, gridLayout) with the configuration of
LayoutManager.
Example:
mRecyclerView = (RecyclerView) findViewById(R.id.my_recycler_view);
mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
//or
mRecyclerView.setLayoutManager(new GridLayoutManager(this, 2));
- Anima common list actions: animations are undocked and delegated to ItemAnimator.
There's more about RecyclerView , but I think these are the main points .
So, to conclude, RecyclerView is one more control Flexible to handle the "list data" that follows the patterns of delegation of concerns and leaves for itself only one task: to recycle elements.
Taken from the @daneejela's response