Android 1



hello, everyone! my name is oum saokosal. i will talk about android recyclerview. it is in english version. i made it in my version already but i decidedto make it for you guys.


Android 1, this is where you can find me. this is my channel oum saokosal and you canalso find me on facebook kosalgeek, twitter okosal and github dot com in kosalgeek aswell. i would like to talk a little about the historyof recyclerview.


actually, we have used listview for very longtime. but listview is not very flexible. android decided to replace it with anotherfeature and they decided to call recyclerview. we will see the flexibility and the advancedtopics about this in association along the way. the recyclerview comes with the cardview. a cardview is the piece of the item that usuallymade it in listview as the external layout. recycler view can get another cool feature,called layoutmanager. you can decide to position from the, scrollfrom the up to the bottom and bottom to up,


scroll down, scroll up, whatever you wantand another cool feature is the viewtype, if you decide to explain multiple items. like, you have two images and then the secondone, you decide to have three images and you can do that very easily in the recycler view. actually it's not easy but it's built in. like, you don't have to include another library. maybe some other source code from somewhereand another one is the view holder. it used to be something that you decide toadd yourself in the listview but now is the part of the library and also the animation.


if you need any cool animation, you can usethat. it is built in. all, maybe just use somebody else's code calledit's like black and it's very easy. and this is some, like i got it from a pinterest. hello, everyone! my name is oum saokosal.i will talk about android recyclerview. it is in english version. i made it in my versionalready but i decided to make it for you guys. this is where you can find me. this is mychannel oum saokosal and you can also find me on facebook kosalgeek, twitter okosal andgithub dot com in kosalgeek as well. i would like to talk a little about the historyof recyclerview. actually, we have used listview


for very long time. but listview is not veryflexible. android decided to replace it with another feature and they decided to call recyclerview.we will see the flexibility and the advanced topics about this in association along theway. the recyclerview comes with the cardview. recycler view can get another cool feature,called layoutmanager. you can decide to position from the, scroll from the up to the bottomand bottom to up, scroll down, scroll up, whatever you want and another cool featureis the viewtype, if you decide to explain multiple items. like, you have two imagesand then the second one, you decide to have three images and you can do that very easilyin the recycler view. actually it's not easy but it's built in.like, you don't have to include another library.


maybe some other source code from somewhereand another one is the view holder. it used to be something that you decide to add yourselfin the listview but now is the part of the library and also the animation. if you needany cool animation, you can use that. it is built in. all, maybe just use somebody else'scode called it's like black and it's very easy.and this is something like i got it from a pinterest. it's a very cool app. even though it'snot very popular, especially in my country, nobody knows pinterest. i live in cambodiabut maybe you know a bit about this but you can see facebook. first image, you have oneimage and second one you have, three images. you can just do that. let me explain a littlebit like, a listview, you can find in my channel


as well.first you have data and you have to create a class that match to the data like, you havea table, let's say, tv in item, you have id text image. then you need to create anotherclass in java. and field must match to the table fields. and then you added to the arraylist. you did cardview. you need maybe one or two but first let's just think about onecat view and then the most difficult part is the adapter and you need another managerlayout and lastly you add it into the recyclerview. even though the steps is one, two, three toseven. but sometimes you just create it first. you need the 7 things before you display somethingin the recycler view. it's a whole process. it's very long process and i will make somepart of it in hd video. i hope you subscribe


my channel and you can see the rest of thevideos. let's go to the android studio before that,i just want to use my channel. this is my channel and i have it in combined. you cansee now and people complain about here like, why you don't make it in english. now i'mmaking it in english. but if you want to see cool things like android, my sql, it is inenglish as well. if i label it like, something like that, it'sgoing to be english. but if i put it in khmer, it's going to be khmer. i hope that you don'tmind about it because i just want to use my channel for my people and you guys. don'tforget to subscribe and this is the channel and this is some in khmer but actually i madeit in khmer language. but now it's just still


a mixing, a little bit. but just subscribemy facebook as well. let's go to this. just create and use an app.it's going to be a basic one. it's nothing new here. it's going to be something likethis. go to setup the android or recyclerview. just go to google, recyclerview like that.go to the first link and then you go to this one. that is good material here and you justtake a look at it. but before you can do anything, you have to add a gradle in dependencies andif you add it, something like that, you're going to see some error but i want you tosee your class. i will teach you how to fix that.the font is too big. so maybe, change font a little bit to sixteen. using 16. it's good.so, now i'm using android studio 2.1.2 okay


the date now is like, 29. because the androidstudio is always updated, so just here, click on sync now. what you can see now. there isan arrow here now because you can see the library for the android now is 23. it was21 now. so, you have to go to this link. v7 support library. so you just, control+s andon command and then you type recyclerview. so here is the letter. so you have to grab,copy and then paste it here inside the single code here.now, over here� copy and sync again. now i think you're good to go. and let's testthe code. so, you have to grab this code here, recyclerview. then you have to go to resourcehere, then layout and actually opened it already. you go to text here. so, now is the shut andclose. so, i want to close this right here.


because you want to put something inside therecyclerview. and then, i don't know the name here. i just call it rv for recyclerview.like that one good item. so it's going to be rv item. okay, that said, so, now, i thinkyou don't need it inside. you don't need it. you need the cat view. so this one is enoughand you want to change the cat links for the overall. just delete this. just do it.let's go here, the data is going to be 2 things. because you going to grab the data. maybeyour data base, your server and i got good example of that how to get data from failing.so, i think you can watch this and grab your data and put it into the recyclerview yourselfor maybe you can just wait for me for a little bit.now maybe, just something like this you can


just do it, like item, card view. so, maybecardview is the good next thing. right click on layout and go to layout here and i wantto call it itemlayout, okay? but i'll want you to choose yourself. so, cardview here.so, in here you need the cardview. so, we go backagain. maybe just grab all of the code. leave it. it's no good, so let's go back.actually it needs it. that's all. if you don't need the linear layout outside, just deleteit. well, for me, i don't like this. so, i just delete it. it's going to be working butyou need this name space. here, it's going to be alright. don't worry. so now you haveone text. so you have a window here. text here. with this, 200, i want to make it thewhole with, use match_parent. whatever parent


name is. and the height is 200. so, i needa layout inside here so, i want to use maybe, linear data for coding. so, what is the orientation? so, it's goingto be vertical. then it's going to be, i'm not sure, i'll have to update it but, youhave to get. i need to put text a little bit and i make sure that text is black. so, it'sjust like, sample text. it's going to be like this always. so, this is the text view. so,i want to have an imageview. sorry for my english. so, this one is going to be matchparent. maybe 300� 200maybe. and source, here i want to have one image.and you have drawable here and you can't havecaps here. you need to have small letters.


lower case. you cannot have space like that.you need only small one and maybe number. just like that. if you put the name in capitalor space, then you're going to have error. i will use my drawable for you. now, i needto scale down a little bit. so, i need the centercrop. it's very annoying. and, this200, so need to increase the whole height of, something like this. so simple thingslike this. this is fine. and if you want to use the reflective. you can use that. maybei have to update it but for now it's fine. so, this is the cardview. so, i have to renameit. this is my cardview. and maybe item and image, i don't have id/ivmainimage and thisone is the standard that you want to add id. and this one is in for text. it's going tobe tvtitle. right. so now, you have the cardview.


so, you need the item, the array and the data.but i think the video is good enough for now. so, let's test it a little bit. so, if thecardview and recyclerview is already inside the project. we already included in the dependency.so, just for recyclerview, you have it. let's paste it outside. rvitem and cardview cvitem.cv item and this one here is rvitem. close this and rvitem, recyclerview. findview by id and then, cvitem. now, you can use it and you can have the layout.and next we�re going to create the item


Android 1

and we going to create maybe a like downloaddata because we don't have the real data, so we cannot make it. it's a dummy data justto display and explain later. you'll put it in the text or images and then in the arraylistand follow the manager. but for now, that's


all. and we are going to see you in the nextvideo.


Android 1 Rating: 4.5 Diposkan Oleh: PaduWaras