Android RecyclerView Tutorial - In Depth Guide incl. Different View Types

preview_player
Показать описание

In this Android RecyclerView Tutorial, you will learn everything you need to know about RecyclerViews.

We have also created an article on our blog, going over this in more depth. Here you can also download the code for this video.

You will learn about RecyclerViews but also about how to use different ViewTypes and how to customize your list items using XML.

Working with RecyclerView in Kotlin
RecyclerViews in Android, are one of the most interesting concepts to become a master in Android. There’s a lot of different examples and implementations across the internet. Learn first, what a RecyclerView is before implementing it.

What is a RecyclerView?
A RecyclerView is a flexible view for providing a limited window into a large data set. It is essentially a ViewGroup of containers called ViewHolders which populate a particular item. RecyclerView is an extensive Android class to provide a flexible UI. A great benefit of using RecyclerViews is that you’re able to efficiently reuse views instead of managing items that aren’t even visible to a user.

Why we use RecyclerView?
In the past Android used to use ListView or GridView classes for displaying lists. The RecyclerView can be thought of as a combination of a ListView and a GridView. However, in a RecyclerView, there are features that separate your code into maintainable components while also enforcing memory-efficient design patterns.

How is it be better than ListViews and GridViews?

ListViews and GridViews are comparatively slower than RecyclerViews.

Layouts in RecyclerView
The RecyclerView changed everything which was used in the ListView and GridView. RecyclerView still uses an Adapter to act as a data source. However, you have to create ViewHolders to keep references in memory.

To provide a new view, RecyclerView either creates a new ViewHolder object to inflate the layout and hold those references, or it recycles one from the existing stack.

This is it why it’s called a RecyclerView!

The Views in RecyclerView comes with default animations that you don’t have to create or add yourself.

RecyclerView requires a ViewHolder, the RecyclerView knows which animation to apply to which item and adds them as required. You can also create your own animations and apply them as needed.

The most important and interesting component of a RecyclerView is its LayoutManager. This object positions the RecyclerView’s items and tells them when to recycle items that have transitioned off-screen. The ListView used to do this work by itself.

The RecyclerView has broken out of this functionality to allow for different kinds of layouts: Vertical, Horizontal, Grid, Staggered, or your own!

There are three types of Layout Managers by default:
LinearLayoutManager: Positions items to look like a standard ListView.
GridLayoutManager: Positions items in a grid format similar to a GridView.
StaggeredGridLayoutManager: Positions terms in a staggered grid format.
RecyclerView implementations require:

A list of data objects to work with.
An XML file of the view item.
An adapter to bind that data to the views.
A ViewHolder to populate the UI view from the XML item file.
Now we are familiar with what RecyclerView is and its basics, let’s get into the implementation.

About this Video:
You learn how to use RecyclerViews in Kotlin. This is important for Android App Development. This Android RececlyerViews Tutorials is the only one you will ever need. RecyclerView Android is generally used by most of the important Apps out there. We are going to build RecyclerView Android Studio. As in this tool it is best to create Android Apps. RecyclerView Adapters are also important, when it comes to making a ListView kind of thing. Basically we are going to make an Android ListView and an Android GridView. Therefore we are going to use the Android LayoutManager.

tutorialsEU offers you free video tutorials about programming and development for complete beginners up to experienced programmers.
This includes C#, Unity, Python, Android, Kotlin, Machine Learning, etc.
Рекомендации по теме
Комментарии
Автор

This is really a complete depth video related to the RecyclerView concept, which really helps the beginner and can cleat there all the doubts. Thanks

ArifKhan-jcog
Автор

Finally got there at the end. Many thanks for this video, looking forward to the next one

captalextamonan
Автор

After watching this video, I think it is a very in-depth video about android & Kotlin. I am not good at Kotlin but Denis I definitely follow the tutorial and will make awesome App.😎😜

spatidar
Автор

Thank you very much, you made it simple

amanuelabiy
Автор

Sir, Your udemy android course is great.
Quality content with low price.
It was first that I bought a paid course after watched that YouTube 7+ hrs video.... Thank you sir for providing great courses....

Sujoy
Автор

Thanks tutorialsEU. this is very help full for me understanding RecyclerView. good explanation.

johnsnow
Автор

Great Explanation. Best video for a beginner like me in Android and Kotlin.
Thanks, Tutorials.Eu

AmitPatel-oejl
Автор

I'm only 2 minutes in and I already have a better fundamental understanding of RecyclerViews, thank you. I'm a visual learner, and the problem with the documents I'm reading and information online is that it sounds so abstract to me because they don't do a good job of describing how things work visually. Thanks, I subscribed

punyan
Автор

Thank you so much for your video...it lessens my two days hardship

ZahraAli-qoxk
Автор

The video was really helpful, thank you for explaining everything clearly. Do you have any videos about Android Navigation on YouTube?

allincooking
Автор

thanks sir, I love watching your videos . Great !

TheFlexath
Автор

This video made me stop crying in its first 5 minutes. you are a hero

magnusjansenvanvuuren
Автор

Your videos are superb with excellent explanation🔥

nayanasenavirathna
Автор

First off I would like to say I love watching your videos, you do a fantastic job of explaining everything.
After watching this video I went out and bought your master class and it has been great so far.
I do have a quick question about the recyclerview.
Say for example you were creating a scorecard and you want to be able to scroll both directions because the columns and rows would both be off the screen.
Would you just have the recyclerview scroll one direction and have that inside a scrollview that would scroll the other direction or would that not work?
Thanks again for doing what you do.

YarnellCrew
Автор

Thank you !! Really easy to understand

thahaziq
Автор

This was a great tutorial, Thank u so much Sir

ziadhemmar
Автор

Thanks for tgis video.
If i have rtl language how to make recycleview change it's derictiin to rtl or ltr according to the language direction? Or it will change the direction automatically?
Thanks in advanced

BackPal
Автор

I'm 12 minutes in, and loving your tutorial already. Liked the video and may consider purchasing your course :)

bardus_hobus
Автор

Hi bro .. Love from India.. Your videos are awesome. I learnt a lot from u. I have a doubt too.. At 39:10. Actually we are passing viewtype as parameter for constructor for datamodel right.. Then it belongs to item in this case. Then how do u say viewtype instead of item.viewtype ..

yuvarajanm
Автор

Very nice absolutely amazing vedio ❤️💗

ashekmahmud