This tutorial is the second part of the RecyclerView tutorial series.
If you don’t know how to use RecyclerView or you need to refresh your knowledge, please read this tutorial first:
In this tutorial, we’ll develop a news application that has a RecyclerView with multiple view-types.
In addition to the RecyclerView’s dependency, we’ll add the CardView’s dependency, because we want to use it in our items’ layouts. So open the build.gradle file in your app module and add these dependencies to the dependencies section and then click on the Sync Now.
// RecyclerView dependency
implementation "androidx.recyclerview:recyclerview:1.1.0" …
This Tutorial is the first part of the RecyclerView tutorials series. If you know how to create a RecyclerView, how to handle click-events, and how to update it, maybe it’s better to read the second part of this series.
If the scrolling list of elements needs to be displayd based on large datasets, the RecyclerView should be used
The RecyclerView is used in almost all Android applications. The followings are 3 different famous applications that use RecyclerView.
You may ask why don’t we use a ScrollView instead of RecyclerView? Imagine you have a list of 1000 items and you want…