[GUIDE] RecyclerView

Hello everybody :wave:,
Today I’ll be guiding you how to use RecyclerView

I’ll teach you how you can create list like following :-

So let’s see how you can also create list like this

1. Create one Horizontal Arrangement
After dropping that horizontal arrangement make the view that you want to make. I have just added one image and one label like this

2. Drag RecyclerView from Layouts section
After dragging go to Blocks screen and we will see how you can create this list dynamically

3. Screen Initialise and also initialise the RecyclerView

This blocks will initialise the RecyclerView

Row Count
Row count means that how many rows will be there

Orientation
This will specify the orientation

Reverse
You have got it from word only

Staggered Grid
Normally every grid item have same height but in staggered they can have different height…for example can be used in wallpaper list

And
SetItemCount will specify the number if items for list

4. OnBindView

This blocks is triggered when RecyclerView is scrolled and it returns the position

5. OnCreateViewHolder
In this block we will create our list dynamically.
This block is triggered when you initialise RecyclerView

If you have ever used Dynamic Components Extensions by @yusufcihan then you will understand this very easily

Now the question arises how to use on click on any component as it is not available in RecyclerView
So for that we will use Any component like this

You can also use schema’s for creating lists
You can refer to this guide

AIA:-
RecyclerViewTutoria.aia (13.8 KB)

[Edit by @Shubh]
Note: If you are making a vertical recycler view then donot put it inside VSA (Vertical Scroll Arrangment) because it has Android Scroll Problem .
To create horizontal recycler view set orientation to 0
Tutorial :-

You can use animation / everything using recycler view (tested / post edited by @Bharat_Android_App)

I hope this Guide helped you
If you liked it please give it a :heart:
If you have any issues then post below, I’ll try my best for helping you
Thank You

9 Likes

I have followed your path and reached here :-

Vertical View :-

Horizontal View :-

Blocks :-

RecyclerView Source
RecyclerView App

If you want to get position / id in number format than add this block with OnBindView event block

and

7 Likes

That’s great @Bharat_Android_App
Thank you

3 Likes

I have set the block follow the step which mentioned above but horizontal arrangements/Card View width or height not set fill parent. I have tried both value -2 and -1. But it’s not working. Please guide me how to set width or height fill parent in RecyclerView.

You can’t use -1 and -2 in recycler view so try percentage values

How set percentage value in block section?

IMG_20220308_100935

I’m taking about these value. How to set width or height fill parent.

-1 for wrap content and -2 for fill parent

1 Like

I have also used -2 for fill parent but it’s not working.

I will show you percentage value error

1 Like

Tyr to on stagerred list view

1 Like

I think its just opposite?

1 Like

Let me check.

1 Like
1 Like

Please make tutorial about recycler view from mySQL and AIA sir, Thanks

Anyone getting stuck or hang type view in this app ??

If yes then just follow bellow steps:-

Just get old position and check if your next position / scroll is greater or equal to the old one if it’s greater then only it will add new values otherwise it will not update every time

This is how it works

1 Like

It’s better to use async image loader component for loading image, it would work without any lag.

2 Likes

Good but if we can add " Native / Native banner ads… it can be better.
Thank you in advance if its going to update.

I won’t use ads component :slightly_smiling_face:

Please Make a Tutorial For Airtable Or GoogleSheet

When im scrolling it stuck to 10