In this tutorial, I am going to explain to you how we can create a Staggered GridView in Android Application and pass that view to our recycler view. Before we start I think that you have knowledge about RecyclerView and adapter if not then please read this post here:- Working with RecyclerView in Android Application.

If you read my last post then it was very easy to understand, there is only one chance in this post and last post that was LayoutManager in this post I am using StaggeredGridLayoutManager for this. So we can start our code in simple steps.

Step 1. Create a new Android project in Android Studio.

Step 2. Import all required library in build.gradle 

Step 3. Create two folders inside the project Model and Adapter to hold data and set data in Android Application.

Create a model file inside the model folder

Now create Adapter file inside adapter folder

We also need a view for an adapter in which we can set data

Step 4. Now open MainActivity class and initialize Model and Adapter class and put data in it from API as show in below code

And you need to call RecyclerView in activity_main.xml file to display data.

That’s it hope this above code help you to create Staggered Grid Layout for your Android application.