Last updated on March 13th, 2020 at 11:59 am
RecyclerView is a new ViewGroup introduce by android and it supposed to be the successor of ListView and GridView, you can start using RecyclerView in android latest support library (Support-v7). RecyclerView is very flexible you can use it as a grid or listview, it also come with some default animation effects.
Start creating a sample app using RecyclerView.
Step 1. Create new project in android studio. And after that you need to add dependencies in your build.gradle and rebuilt it. In this sample i am loading image from server so i am also using picasso library.
Step 2. Now open activity.xml file and add recyclerview layout in it.
Step3. Now create new adapter class which extends RecyclerView.Adapter as shown bellow
Step 4. Now create Getter Setter class to get and set values to view
Step 5. Create a new layout file which we are going to inflate data
Step 6. Now open your MainActivity.java class and add following code
In this you can also handle click on your view
For complete code follow download link above.
🙂