
Lets create an Activity MainActivity and add the following in the activity_main. This feature is achieved easily using RecyclerView. In the Twitter app, you find a list of tweets from different people. It is an container for rendering larger data set of views that can be recycled and scrolled very efficiently.īefore discussing Diff Util, let's discuss the RecyclerView Implementation, For example, the inbox of your Gmail app, you find a list of people who contacted you. In this post, we will create a basic item list using RecyclerView and implementing the View.OnClickListener. RecyclerView is flexible and efficient version of ListView. A very simple example of Android RecyclerView. a device or emulator running Android API level 23 or higher 1. For example: if a user scrolled down to a position where the items 4 and 5 are visible items 1, 2 and 3 would be cleared from the memory to reduce memory consumption. In this blog, we will talk more about updating the recyclerview using DiffUtils What is RecyclerView ? This improvement is achieved by recycling the views which are out of the visibility of the user. If you are living in 2019, I am pretty sure you might have used RecyclerView. Gradle Scripts > build.Ever built a List in Android ? What did you use for it? ListView or RecyclerView. Add the following dependency in your Gradle build file to use recyclerview. The RecyclerView widget is a part of separate library valid for API 7 level or higher. For using this widget we have to specify the Adapter and Layout Manager.


It is mainly used when we have data collections whose elements can change at run time based on user action or any network events.

In Android, RecyclerView provides an ability to implement the horizontal, vertical and Expandable List. In RecyclerView android provides a lots of new features which are not present in existing ListView or GridView.

This new widget is a big step for displaying data in Material Design because the ListView and GridView are one of the most commonly used UI widget. RecyclerView was introduced in Material Design in API level 21 (Android 5.0 i.e Lollipop). It is a container used for displaying large amount of data sets that can be scrolled very efficiently by maintaining a limited number of views. In Android, RecyclerView is an advanced and flexible version of ListView and GridView. RecyclerView Tutorial With Example In Android Studio
