RecyclerView (Kotlin Beginner Example)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video I'm gonna show you how to set up a recycler view using Kotlin I know that I have shown you how to set up or cyclic views using Java on Android in the past and now since I'll be doing pretty much Kotlin exclusively moving forward I thought I'd better start updating some of these beginner videos so in this one we're going to be showing you how to set up a infinite to theoretically infinite scrolling recycler view using Kotlin so on the screen here I have an example I have a recycler view it's got some images it's got some text so there's a title there's also a author associated with this fake kind of blog post in this recycler view so you're gonna be learning a couple things you'll be learning how to display images and text in an infinite scrolling recycler view and also how to use a card view within this infinite scrolling recycle view as you can see there's kind of these little cards associated with each one of these list items so a pretty cool example very simple example but a very common use case so the images in the example are going to be displayed from the internet so they're gonna be retrieved using image URLs I'm gonna add some kind of fake data to to a data set we're gonna build a recycler view adapter from complete scratch so you get to see all the steps kind of involved in that this is going to be everything you need to know about building a recycle view in a recycle view adapter basically and let me know in the comments if you want to see more videos like this for example how to detect clicks to the list items and then navigate to different activities and things like that so without further ado let's take a look at the code so as I said we're going to be doing this from complete scratch so I'm going to start by creating a brand new Android studio project and I go to empty activity go to next I'm gonna call this just call it Colin Colin recycler view example or I'll do EXO that we have the example project on my computer you can call whatever you want doesn't matter package name where I want to save it I'm actually going to save it to a different directory this is going to go into my D directory but again it doesn't matter wherever you keep your Android studio projects I'm going to keep it right here inside of D Android studio projects language is Colin minimums and I want to choose the Android X artifacts because we are gonna be using Android X if you don't know what Android X is I have an article on my website you can check out goto coating finish column slash blog and there is a Android X article right here what is Android X it's just a way to organize dependencies that's all it is but you should know about it so click that go to finish and let Android studio build your project once Android studio has built your project you should be seeing something like this just a brand new project open up we got activity main and we got main activity no big deal nothing special here so the first step is we need all of our dependencies we need all the things that we're going to be the external things that we're going to need for the project so I'm going into the build Gradle app file I can get there by expanding Gradle scripts over here and making sure that I have Android selected from the navigation up here so opening up the build up Gradle module app folder right here or module app file right here this is where we add any external dependencies that we're going to use for the project things that aren't included in Android studio by default and to save time I'm actually just going to go to the github repository for this project there'll be a link in the description of this video it's called Kotlin recycle of you example it's just the code for this this video and I want to go and get going to the app folder and then going to build Gradle right here and here's what we can just copy those dependencies it's just gonna make things it's just gonna save a little bit of time so I don't have to type these out or find these in the documentation so I'm just copying those I'm going back to Android studio which is this one right here and I'm going to just press control V and paste those in so we have the cardview dependency we have the recyclerview dependency then we have the glide dependency so the cardview dependency is for displaying those little cards that i showed you in the demo these kind of little cards that these views are sitting in the recycler view dependencies obviously for the recycler view itself and then Glide is for displaying images it's a it's a much easier way there's a couple of image loading libraries out there today there's Picasso there's Glide there's frezz Fresno I believe it's called which is made by Facebook there's also a new one named coil which I don't recommend using it because it's it leaks memory from what I've seen I've tried it out glide is currently the one I go with so just use that one if you don't know what I'm talking about what I'm saying you're confused just click sync up here and keep following along with me okay so the next step in this procedure is we need to model the data that we're going to be displaying in the recyclerview so as you can see from these list items from the recycle view itself these are I I called this model a blog post because there's a thumbnail there's a title there's an author and there's actually some content to the blog post inside of the model that we build but you don't see that obviously because we can't click on them in this video but the first step is always modeling the data what do you want your list items to look like so that's what we're going to start building for the next step so we need to build this model class so I'm going to go into the main package directory again I'm just in the Android view here I have Java comm coding with Mitch which is my package recyclerview e^x which is the name of the project right clicking here going to create a new package just to keep things more organized I'm gonna call this package models and inside of models I'm going to right click go to new collin file and this is going to be called a blog post because it's going to be a blog post object for modeling our data in our cycle of view so i'm going to create a new class it's going to be class blog post and inside here we need to add some fields for this blog post so I'm opening up the brackets here to create a constructor this is something a lot more convenient with Kotlin as compared to Java in the past we had to add fields add the getters and setters add any methods but with Colin it's much easier we can create something called a data class and inside the data class we can add the properties to this blog post object or to ever whatever model object you're creating and you can just add them right here so the first one is going to be a title and the title is going to be a string it's going to be a string type the second parameter is going to be the body that is also going to be string type the third one is going to be an image this is also a string type and if you're new to Android development you might think that's kind of strange why are we saving an image as a string the reason behind that is we're actually saving the a pointer to where the image lives on the internet and I'll show you exactly what I mean so if you go to this github repository github calm Tavian blog images these are the images that we're going to be displaying in the application that I showed you here so the images here are actually the ones that I'm showing in the app they're being retrieved from this github repository so if I click on one of them for example coding for entrepreneurs PNG you can see that there is an image it's a little too big to show on my screen but there it is so what we're going to be actually saving to our blog post model if we look at our object again we have an image field that's being displayed as a string what we're actually saving is if I go to open image and new window this is what we're saving this pointer right here raw github user content calm which Tavian blah blah blah blah blah blah it's a pointer to where that image is saved on the internet that is why it's saved as a string because this is a string it can be saved as a string just like if I was to go I'm just going to main activity I can just do value pointer equals string there is a string that points to where that image lives on the internet so that's kind of the the concept behind that if you were not aware okay so the last parameter is going to be the user name this is again going to be a string and this is the this is going to be the user name of the author that has written the blogpost so next is the data source for the data in the recycle view and I'll bring the demo application on the screen here just to show you again so normally when you know if you're building an app in a real world application or if you're a student and you're building some kind of an application typically what you do is you're not going to be hard coding in the data into the project itself you're going to be retrieving that data from somewhere else on the Internet just to give you like another example we can go to I built this website for students of mine to use just as a kind of an open source API so it's open API XYZ here members on my website can create blog posts and they can use this as kind of a place to test their applications so they can retrieve this data from their apps and then display it so usually typically what you do in a real app is say I wanted to retrieve the data for this blog post here on the screen this one right here it has an image as a title has some content just some fake content has a date and it has an author so if you want to build an app you would want to retrieve that information from the internet that's what you would do in a real world application but to keep things simple because this is just kind of a beginner recyclerview example we're gonna be hard coding in the data into the project because it's there's a lot more steps involved if you want to retrieve it from the internet and I have courses on that on my website if you if you're curious you can just go to Cody with Mitch comm go to courses and I have a bunch of courses on retrieving information from the internet building apps in particular the REST API with mvvm and retrofit to that is a good one that's a good place to start so anyway we so we need a data source so what I'm going to do is go into our main package directory go to new Kotlin class new collin file and i'm going to call this data source and it's just going to be class data source and we're going to add something called a companion object to this data source class and this is where we're going to add some kind of some dummy data that we can display in our recycle of view and again to save time i'm going to go to the github repository for this project so again link in the description of this video the repositories collin recyclerview example just go into the app folder going to source go into main go into the main package directory and go and click on this data source class right here so data source kt and you can just copy this whole thing so all the way from the class declaration all the way down to the bottom pressing ctrl c on that and i'm going to paste that in and here's some dummy data it's going to tell you that you need to import the blogpost object which we have created so i'm pressing alt enter and importing that and there you can see that import up at the top so all this is is it's a it contains it's a data source class with a companion object with a single method that returns an array list of blog post objects and these are just this is just hard coded data so you can see that each blog post has a title each one has a body an image so that's just an image URL pointing to where that image is being stored on github and then a username to like a pretend author to that blog post so it's pretty simple it's just a bunch of dummy data that we're going to be displaying in or recyclerview as you saw in the demo application that's all this is and again I want to say that in a real app you don't do this you don't hard-code in data into your project you get it from somewhere on the internet you query a REST API something like that and again I have courses on stuff like that if you want to learn kind of the next steps after playing around with this dummy data okay so now that all the housekeeping is done aka we have data that we can actually display in an app we're ready to start with all the recyclerview stuff so the next step is actually that we're the first step in creating the recyclerview is building a layout for the list items so what what I'll bring the example back on the screen here so what do we want each individual list item to look like that's what we need to to design so each one is going to have an image it's gonna have a title and it's going to have the author kind of displayed in some smaller grey text down at the bottom and once again to save time we are going to copy paste in a layout so I'm going to right click on the layout folder go to or the layout directory go to new layout resource file and this is going to be called layout I'll do blog list item so underscore blog underscore list underscore item and this is typically what I like to name my my list item classes my list item layouts for any of my recyclerview items it's usually layout the object which in this case is a blog and then underscore the list item that's just typically how I do it everybody does it a little different but that's kind of my naming conventions that I like to follow so here we are inside of our layout and I'm gonna go back to the github repository for the project again by now you should know where it is there'll be a link in the description of this video and we want to go into main go into res go into layout and going to layout to blog list item and I'm just gonna copy this entire thing so I'm highlighting everything copying the whole thing going back to Android studio and pasting that in and on the right here it shows you kind of what that layout is going to look like so we scroll up to the top we have a card view so we're making use of that card view dependency that we looked at at the beginning of the video we have a card elevation attribute what a card elevation attribute does is I'll bring the demo over here on the screen gives it this this kind of shadow this elevated look to it and before I continue I need to make sure my dogs aren't barking so I'll be right back so I'm back now my dogs are no longer barking we have this so we have this card elevation that kind of gives it this elevated kind of shadowy look at the top the on the cards it has a card corner radius so that's going to be the curvature of each car view on the edges there and then card prevent corner overlap so that prevents images from overlapping over the corners typically I like to write add this I'd like to set this to false because I already I predetermined the size of my my images usually I make them myself I don't think in most cases depending on your scale type of your image it's not going to make a difference like if we come down over to the image view here and if we set the scale type to Center crop I don't believe it will make a difference because it crops the image anyway but if we're gonna predetermine the sizes of the of your images which I have obviously because I made these images I like to do fit XY which will fit them perfectly to the view as long as they're all the same and I set the card overlap to false so just kind of a kind of a tip I guess if you're gonna make your own images which I'm guessing most of you watching this video are not going to be doing that so next as we come down we have the image view so that's just the image being displayed there and actually before I continue I just want to point out that if you're confused about this layout and you're not really sure about how to build layouts you don't know a lot about it this video is not focused on that go somewhere else to learn about that cuz I don't want to spend a ton of time on it I'm going to be going through this pretty quickly so the image view is where the image is displayed obviously has an ID has some constraints to it because it's inside of a constraint layout we have a linear layout below that with a vertical orientation and then just two text views so one text view on top of the other one is the title one is the author down here so pretty straightforward basically it's just image title author pretty simple nothing really fancy and so now that we now that we have this this layout this layout designed now we can go ahead and start working on the recyclerview adapter and if you're new to Android development and heard of this term recyclerview adapter it's um every recyclerview that you build you need an adapter class what it does is it takes the data that you want to be displaying in that recycle of you and it adapts it to the recycle of you so it adapts it to the recycle of you and the layout that you designed for it so like that layout that we just designed we have a data set which we haven't gotten yet but we want to adapt that data set to the recycle of you you always need an adapter they're always very similar so lucky for you you can probably just copy mine okay so let's get started building that adapter I'm going to right-click on the main package directory go to new Kotlin file and I'm going to call this blog recycler adapter typically that's how I named my adapter classes like I like again like I said with the layout everybody does it a little different usually I go like the object that it's gonna be modeling and then recycler adapter that's that's just typically how I do it again there's no right way here it looks like I clicked on the wrong package this should be inside there there we go I'm gonna close this to give me some more room and let's start writing the class so I'm gonna go class blog recycler adapter and I'm going to extend by recycler view dot adapter so I'm extending by the generic recycle of view adapter class and inside here I need to pass a type so I need to tell it what type of view holder is going to be recycled in my list so I'm gonna be extending the generic recycler view view holder class because typically when you use a recycler view you can display different types of views different types of view holders in this project we just have a single one but typically you want to extend by the generic one because that way you can very easily display different views and if you want to see videos on that make sure to leave a comment or yeah leave a comment below and I'd be more than happy to make videos if enough people want to see that so so the first step here is we need to declare the data set that we're going to be displaying in the list so I'm going to go private var for variable it's gonna be called items it's going to be a list of blog post objects and I'm going to set that equal to a new ArrayList so it's going to be an ArrayList of blog post objects and you can see up here it's got this red underline kind of warning this is telling me that I need to add whatever classes that are inside or whatever methods are associated with the recyclerview adapter extension so I'm going to click alt enter on here go to implement members I'm going to highlight all of those and click enter I'm going to delete all of these two dues by just pressing ctrl Y on each one of those and these are all the required methods for a recycler view adapter I want to add or cut this and keep this at the top so these these are the three required methods you have on create view holder get item count and on bind view holder typically I like to have them in this order so get item count at the bottom and that's because this is the easiest one so all you got to do here is do items dot size so this get item count determines it tells the recycler view how many items are inside of your your list on create view holder is for telling the recycler view or it's for creating the different view holders in the list so if we take a look at the demo each one of these is technically a view holder so that's a view holder that's a view holder so this method is responsible for creating creating each one of those individual view holders and I guess this is a good time as any to tell you actually how a recycler view works so it keeps only the list items that are visible in stored in memory so as the as the user Scrolls kind of only only this view holder is kept in memory and shown to the user this one down here obviously this one down here and a couple above and a couple below so as they scroll it takes out the view holders that are not in view and it adds the ones that are coming into view so if I'm scrolling up it's removing the ones from the bottom and adding the ones to the top that's it's the most efficient way to display kind of infinite a list with the infinite number of entries it makes sure to optimize memory usage basically you don't want to be saving things in memory that aren't even visible to the user there's no point in that so that's kind of how it works so now before we move forward we need to build our view holder class so every time you have a recycler view you need to build a custom view holder class that describes what it means to or what the views are going to be looking like in your recyclerview so you kind of you want to you want to take the data from the data set and you want to set it to a view holder that's basically how it works so I'm going to create a new class so class blog view holder and I need to write constructor and inside the constructor you want to take a single parameter it's going to be item view it's going to be a view object so I need to import view and then I want to extend this blog view holder class this one that I just created by the generic recycler view view holder so recycler view dot view holder and the reason I'm extending by recycler view dot view holder is because that is the type that we passed up here to the adapter so this is recyclable you don't adapter the type is recycler view view holder so I'm creating a view holder class and I actually need to pass the item view as input here so it's passing the view as input to the constructor of the view holder and now inside of this custom view holder we can set all of the properties to that view so value the first one is going to be the blog image and you're going to be confused as to where I'm getting this from so I'm gonna tell you in just a second this is going to be blog image next one will be the blog title whoops this needs to be value so value blog title equals item view dot blog title and this one's gonna be value blog author again just hang on I know you're confused I'm gonna explain this in just a second and there's that blog author so the the parameters inside this view holder refer to the IDS inside of the layout for the the recycler view items so remember this layout blog list item this is the layout for each individual list item in the list if we take a look at the IDs we have blog underscore image we have blog underscore title and we have blog underscore author so those are the IDS that I'm referring to right here so that ID it might be a little confusing to you because these are actually named the same thing so for clarity I'll change the name of this so I'll do blog title blog image and blog author so item view dot this thing is the ID so blog image is the ID of the image view right here and blog title is the ID of the text view right here and blog author is the ID of the text view right here so that's how I'm associating these these these views to the view holder class which is inside of our adapter now the last thing I need to do for the adapter is create a bind method and this is going to be responsible for taking each individual blog post object and actually binding it to the views in the layout so binding it to these things right here these have add these have pointers to the view from the layout and now I want to take the properties of the blog post and set them to those fields so the first thing is going to be setting the blog title and the blog author cuz those are simple so blog title dot set text and I just want to do blog post dot title and I can copy that line by pressing control D and I just want to change this to blog author and set this to a user name now next we want to set the image now the image is a little bit more complicated because we have to use glide the image loading library that I mentioned at the beginning of this video so if you go into the build Gradle app file you have your Glide dependency right here that's for setting images so that's what we're going to do next so first I need to create a request options object which is a glide object it's an object that's used to set some defaults to any images that you're going to be setting so I want to do equals request options I want to set a placeholder so I'm gonna do our drawable icy launch your background and then I want to do dot error and do our drawable I see launcher background so all I'm doing here is I'm setting some default properties to glide and telling it what to display if there's an error or if for some reason the image can't be displayed so a placeholder and now I want to actually try setting that image so I want to do glide dot with context in this case the context is item view dot context I want to do load so this is the image resource so blogpost dot image remember that's our image URL pointing to where the image is located on Hubb if I go to github just to remind you that could be this with this one for example if I was looking at a different one it could be this one you would click on it go to go to this right here that would be an example of one of the resources that are being displayed and now I want to tell it where I'm loading that resource into so in this case we want to load it into blog image that's the image view that we have inside of our layout blog list item this right here so now that we have our view holder we have kind of the the hardest part about setting up a recycle of view all finished now we're going to come up here and finish up so we an on create view holder I want to return a new view holder object a new blog view holder object so I'm going to create that new object and this is what I need to pass to it layout inflator dot from and I want to refer to the parent view so the view group I can do parent context and don't worry if you're confused by this it's going to be literally the exact same in every single recycle view that you ever make so you can just copy this I want to reference the layout reference the parent and do attach to route equal to false so every single recycler view that you ever make is going to be exactly the same so you can literally just copy this other than obviously if you have a different layout name you would change that right here so pretty pretty straightforward stuff now inside of on bind view holder we only have a single view holder but typically you probably will have different view holders again that's usually how recycler views go you have different view holders at the display in different scenarios in this case we just have one but it doesn't matter we can still use a when statement so I'll do when the view holder is of type blog view holder then that means this is what I want to display I want to do holder dot bind I'm calling our bind method right here so I'm referencing the view holder calling dot bind and I want to pass items so that's our list of data get and then reference the position and that's going to bind the data to the particular view holder that is currently in view so if you can imagine while a user scrolling this one comes into view on bind view holder will be called the data associated with that particular list item will be bound the image to the title to the author if I kept scrolling on bind viewholder would be called for this one the image would be bound the title we bound the author would be bound and so on that's that's the whole idea behind this and that is pretty much it the last thing we need to do is just create one more method called submit list and this is how we actually submit the blog post data the list of data to the recycle of your adapter so I'm submitting a list of blog post objects and I'm just going to do items equals blog list that's all it is I'm setting the data everything else will be handled all right so we are almost finished the last kind of steps here is now just going into main activity and we're going to set up the recycler view so I'm going to come down below on create and I'm gonna create a new function a new method so private Phung are fun I'm going to call it an it recycler view I almost always call it an it recycler view which is kind of a convention that I use and now we're going to do some Kotlin stuff so we're gonna do recycler view which is the ID or do oh I didn't even add the recycle view actually to activity main so we still need to do that so going into activity main I'm going to delete this text view that came in here and I'm gonna add a recycler view widget go to match parent match parent I'm gonna give it an ID of recycler underscore view I'm gonna close that off I don't you don't actually need to give it any constraints since it's the only view inside of this constraint layout but typically you'd want to do like constraint top to the top of the parent you'd want to do constraint bottom to the bottom of the parent constraint left and then constraint right but since this is the only view inside here you don't even need these so you can add them if you want or not whatever it doesn't make a difference so now now we're going to come back to the last step that I was just about to work on I'm gonna reference the ID of the recycler view so recycler underscore view which is this ID right here and I want to write dot apply and what apply does is it makes me able to access the recycler view without having to actually write the ID explicitly so I you know what I'll do is I'll read it I'll write out all these things normally and then I'll show you what it would look like with apply because if you're looking at any examples on Google in their Google samples or on the documentation they almost always use this notation so I kind of wanted you to be aware of it but I'll show you it what it looks like without it and then I'll show you what it looks like with it just so you can see the difference if you're new to cotton so the first thing you want to set to any recyclerview is a layout manager so you want to do recyclerview dot layout manager and in this case we just want to use a very basic linear layout manager some of the other options you have are like a grid layout manager if you want to display a grid of items you can do horizontal recycle views we're going to be doing a vertical linear layout linear layout so I want to do a linear layout manager and then just do this at main activity and that will set up just a basic vertical recycler view which is what we're going to be using in this example now I want to initialize the blog post or the blog recycler adapter so I'm going to be using a late and knit object so our late init type so private late and knit VAR I'm going to call it blog adapter and that's going to be a blog recycler adapter type so for those of you who are new to Colin this late and knit object it the thing that it replaces in Java is a lot of the time in Java when we were building Android apps we'd have to declare a declare a null object and then later we you know like in oncreate we would then initialize that object so we do like blog adapter equals blog recycler adapter and then initialize it like that well with Colin you don't need to set it equal to null you can do use something called a late and knit variable which means it's not nullable but it's going to be initialized very soon so it's kind of like if you if you want to declare a global object but you don't but you don't want it to be null and you're gonna be initializing it very quickly like pretty much right away like in oncreate and we do this a lot in android development so that's that's kind of where the late and it comes from so I want to initialize it down here inside of my init recycler view method and do a knit recyclerview inside of oncreate and the last step here then is to do recyclerview dot adapter and set it equal to that blog adapter so that's going to be everything we need to actually set up the recyclerview now that you've seen me set it up without using apply now I'll show you what it looks like with apply so if I would wants to do recycle of U dot apply the only difference here then is it implicitly refers to the recyclerview inside of apply so instead of having to write the idea of the recycle view every single time I can just do layout manager and it knows that I'm referring to the recycler views layout manager same with the adapter I don't need to I don't need to reference the recycle of view it just knows that I'm referring to the recycle of U so it's kind of just a more efficient way to write something if you're going to be applying a bunch of methods or a bunch of things to a particular object in this case it's the recycle of view so now that we have the recycler view set up we need one more method to set it get the data and submit that list of data to the recycler view so I'm going to private fun add data set is what I'm going to call it and I'm just going to do value data equals data source do create data set which is that method that companion object within our data source class so this create data set method right here so I'm getting that data that ArrayList of data and now I'm going to submit that list to my blog adapter so I'm submitting the data so now I just want to come up here and see one create and do add data set now something's actually missing but I want to run it before I show you the thing that's missing just so you can kind of see what I'm talking about oh I actually forgot something not not the thing that I said I was missing but we need to add internet permissions since we're retrieving images from the internet so I need to go into the manifest do users permission give it internet permission and just close that off now I'm going to run that again so just pressing the play button and we'll take a look and I forgot one more thing in blog recycler adapter I forgot to actually apply these request options so underneath glide dot with the context I want to do applied default request options and then I passed those request options so we declared them but I forgot to actually set them to glide and that should that should be everything that we need now I'm going to come up here and run it and let's take a look and again I want to point out that there's still going to be a problem with this but I want you to I want you to see it first so here's the application running we have kind of we have our images we have our titles we have our authors all looking good but it's not quite right if you take a look at the demo app that I showed you at the beginning of the that I've been showing you throughout this there's a there's a spacing here that we don't have with the current recyclerview so and if you don't have that spacing the cards don't really show properly and you can't see you can't see the elevation and it doesn't look as good so we need to fix that we need to add something called item decoration to the recyclerview so again if we look here there's no spacing so we need to add some spacing so this is actually very easy to do I'm going to go into our main package directory going to just right click here go to new Kotlin file new Kotlin class and I'm going to call this top spacing item Dec declaration and this is going to be so class top spacing item decoration private value padding is going to be the input so this is going to be the padding that's going to be in between the individual list items I want to extend the recyclerview dot item item decoration class add the constructor and now inside here I just need to insert one override method so I'm pressing ctrl o going to get item offsets and making sure that it's the right one that was actually the wrong one and pressing ctrl Z to get rid of that I'm going to insert so I'm pressing ctrl o again and I want to go to this one right here actually I don't think it matters which one as long as they both have the out rect right here the out rect object I don't actually think it matters but I'm going to grab this one and inside here I want to apply some padding to the top of the recyclerview so to the rectangle of the view holder basically so I want to do out rect dot top and set that equal to the padding so pretty simple stuff now I just need to come into main activity and I need to actually apply that item deck raishin so I'm going to go value top spacing top spacing decoration we can just call it do top spacing decoration pass some padding so passing some kind of value for the spacing in between each list item and then I want to just do add item decoration and pass that top spacing item decoration pretty straightforward and it very easily adds some spacing so if you didn't see what I did there I just pressed shift f10 to run the app again now the app is is running I'm going to bring it over on the screen here again and we have now that spacing in between our list items so pretty cool stuff very simple example you can see that placeholder image being loaded as I was scrolling we have our spacing we have our shadow everything is working as we expect so hopefully that was helpful I know a recycle of you is probably the most common thing you you do in Android development pretty much every application has lists of data and recyclable use are pretty much the same once you've done them enough there you know the adapter is largely the same the only thing it changes is the data that you're displaying and then therefore the view holder that you build and the layouts the different layouts in them and then you can add different stuff like item decoration you can add animations you can add loading view holders all kinds of different stuff but this was just an introduction so I wanted to show you kind of the basics displaying text displaying images setting up the adapter and doing it all with Colin so pretty pretty basic stuff but stuff you would use all the time in Android development and before I end the video I just want to mention my website once again my websites a great resource for learning Android development for all levels if you scroll down to the home page of Cody with Mitch comm you can see kind of an Android learning path I have courses for absolute beginners and then all the way up to advanced very advanced courses anything from retrieving stuff from the internet caching data proper architecture so I do a lot of stuff on Jetpack architecture you can see up top there's a course that I've been working on right here this is powerful Android apps with jetpack architecture this is a really good one we're gonna be using Kotlin actually mvi architecture not mvvm architecture live data and view models navigation components which is a new way to navigate your apps using fragments the rune persistence library co-routines retrofit dagger all kinds of really cool stuff I really encourage you to check that out of course that is a paid course and I know not everybody can afford paid stuff so if you can't there's tons of free stuff on here for example my SQLite for beginners course that's completely free so I encourage you to check check out my website also actually before I move on I should mention that if you do become a member on my website you also get access to a discord channel where all the other members on my website we kind of hang out we talk about problems we chat about stuff I'm in there every single day so if you got questions that's a good place to ask me and everybody else in the in the disc or channel is also very helpful so that is gonna be it for this video thanks for watching if you liked it leave a like if you got a comment you want to see something else you want to see any particular topic make sure to let me know because if I get enough people wanting a topic I will always do it or most I will usually do it like I said if I get enough people so thanks for watching and I'll see you the next one you
Info
Channel: CodingWithMitch
Views: 54,582
Rating: 4.915916 out of 5
Keywords: android tutorial, recyclerview, android recyclerview, recyclerview example, recyclerview tutorial, android recyclerview tutorial, android recyclerview example, how to use recyclerview, android list, android scrolling list, recyclerview with images, recyclerview with images and text, custom recyclerview, recyclerview android, kotlin recyclerview, recyclerview kotlin, kotlin recyclerview example, recyclerview kotlin example
Id: Jo6Mtq7zkkg
Channel Id: undefined
Length: 39min 21sec (2361 seconds)
Published: Mon Aug 26 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.