Design + Code an Android App from Scratch
The RecyclerView widget is a more advanced and flexible version of ListView. This widget is a container for displaying large data sets that can be scrolled very efficiently by maintaining a limited number of views. Use the RecyclerView widget when you have data collections whose elements change at runtime based on user action or network events. The RecyclerView class simplifies the display and handling of large data sets by providing Layout managers for positioning items and Default animations for common item operations, such as removal or addition of items. You also have the flexibility to define custom layout managers and animations for RecyclerView widgets. To use the RecyclerView widget, you have to specify an adapter and a layout manager. To create an adapter, extend the RecyclerView.Adapter class. A layout manager positions item views inside a RecyclerView and determines when to reuse item views that are no longer visible to the user. To reuse (or recycle) a view, a layout manager may ask the adapter to replace the contents of the view with a different element from the dataset. Recycling views in this manner improves performance by avoiding the creation of unnecessary views or performing expensive findViewById() lookups. RecyclerView provides LinearLayoutManager which shows items in a vertical or horizontal scrolling list, GridLayoutManager which shows items in a grid, StaggeredGridLayoutManager which shows items in a staggered grid.