RECYCLERVIEW - Android Fundamentals

  Рет қаралды 106,794

Philipp Lackner

Philipp Lackner

Күн бұрын

Пікірлер: 223
@ohmegatech666
@ohmegatech666 Жыл бұрын
OK I didn't understand your explanation of what RecyclerView does but after looking it up now I understand. When a view (the container for one of the rows) goes off screen, instead of just being off screen and taking up resources for no reason, or just being deleted and replaced with a new one, Android keeps it but replaces all the content (the actual image and words you see) with new content. This way the system doesn't need to store all the hundreds of views (which would eat up all the memory), and it doesn't have to constantly delete view objects only to replace them with new ones (which would use up CPU power). Instead it only creates the minimum number of view objects (however many fit on the screen) and just replaces the content in them with whatever needs to be displayed.
@Domo22xD
@Domo22xD 2 жыл бұрын
Okay so I see a lot of people have problem with this tutorial. Problem 17:36 So in your build.gradle file add this code inside of android {} and make sure you press sync. BUILD.GRADLE buildFeatures { viewBinding true } And this is how your code should look like. CODE: class ToDoAdapter(var todos: List): RecyclerView.Adapter() { inner class ToDoViewHolder(val binding: ItemTodoBinding) : RecyclerView.ViewHolder(binding.root) override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ToDoViewHolder { val layoutInflater = LayoutInflater.from(parent.context) val binding = ItemTodoBinding.inflate(layoutInflater, parent, false) return ToDoViewHolder(binding) } override fun onBindViewHolder(holder: ToDoViewHolder, position: Int) { holder.binding.apply { // tvTitle this now works } } override fun getItemCount(): Int { return todos.size } } This is not bad tutorial but for beginners it's hard. Also Philipp should update with pined comment or something about this problem. And how to solve it. Enjoy
@renatovg6337
@renatovg6337 2 жыл бұрын
Thank you, it works!!! Yes, and update or at least a pinned comment is definitely needed.
@Domo22xD
@Domo22xD 2 жыл бұрын
@@renatovg6337 Croatia? I ask because of VG in username?
@chairulfajri9030
@chairulfajri9030 2 жыл бұрын
He used buildgradle:app plugin add id 'kotlin-android-extensions'
@AB-sq1sy
@AB-sq1sy 2 жыл бұрын
King
@ViperVGP
@ViperVGP 2 жыл бұрын
Thanks a lot!
@ARIZONAMUSIC
@ARIZONAMUSIC 3 жыл бұрын
the best explanation ever I'm learning android programming in Kotlin and for 1 week I've been trying to understand RV setting. Thanks you lot, Phillip!
@PhilippLackner
@PhilippLackner 3 жыл бұрын
Glad it was helpful!
@mrodriguezalas
@mrodriguezalas 4 жыл бұрын
A really easy improvement for anyone reading is to add etTodo.text.clear() to remove the text for the item that was just added. btnAddTodo.setOnClickListener { val title = etTodo.text.toString() val todo = Todo(title, false) todoList.add(todo) //update recycler view adapter.notifyItemInserted(todoList.size - 1) // Clear text etTodo.text.clear() } Nice tutorial, thanks!
@abrammedrano991
@abrammedrano991 3 жыл бұрын
I was stuck on a problem for a whole day until I saw this video! Thank you!
@guy1407
@guy1407 4 жыл бұрын
Thanks for the great demo On minute 18:50 , I used an inner apply : todos[position].apply { txtTitle.text = title chkDone.isChecked = isChecked }
@terrencejackson4451
@terrencejackson4451 3 жыл бұрын
I havent seen the video yet but.... CAN WE TALK ABOUT HOW COOL THAT INTRO TRANSITION WAS???!!! xD
@tiagocastro9039
@tiagocastro9039 Жыл бұрын
I think this video is very clear. I'd just add the mention that as an option to LinearLayoutManager you can have LinearLayout.Horizontal in case you want to have it scrollable horizontally.
@megumin4625
@megumin4625 3 жыл бұрын
Anybody wondering why your viewbinding isn't working? Here's how to fix it -->>> 1. Set it in gradle -> (NOTE: this belongs under -> android { } , section) buildFeatures { viewBinding true } 2. Use LayoutNameBinding as the class to inflate from in onCreateViewHolder (as "LayoutName" suggests, you replace this with the name of your xml layout) val layoutInflater = LayoutInflater.from(parent.context) val binding = LayoutNameBinding.inflate(layoutInflater, parent, false) return MyViewHolder(binding) 3. Send the binding to the ViewHolder (update the viewholder to hold a reference to LayoutNameBinding type) inner class MyViewHolder(val binding: LayoutNameBinding) : RecyclerView.ViewHolder(binding.root) 4. Enjoy viewbinding in onBindViewHolder() method! holder.binding.apply { tvtext.text = somedata message.text = mymessage date.text = date } (NOTE, you may need additional implement's or whatnot in gradle. You can google for those)
@crateer
@crateer 3 жыл бұрын
Lifesaver! Thanks!
@amalsunil4722
@amalsunil4722 3 жыл бұрын
Thanks a ton buddy, Have a great day my friend!
@Prskati
@Prskati 3 жыл бұрын
This should be pinned. Wasted a headache trying to understand what was wrong
@abdulwehabmohammed5580
@abdulwehabmohammed5580 3 жыл бұрын
Thank you very much.
@KotlinBek
@KotlinBek 3 жыл бұрын
thanks
@vasiliv6872
@vasiliv6872 3 жыл бұрын
Thank you Philipp, for the great tutorials! I follow the ANDROID FUNDAMENTALS FOR BEGINNERS and the tutorials are perfect so far.
@nipponetzel
@nipponetzel 4 жыл бұрын
at 17:14 in onBindViewHolder function I write holder.itemView and then . (dot) android studio doesnt find or recognize tvTitle or cbDone, I cant access those. Could anyone (or you Philipp Lackner) tell me what can be the problem? What am I missing? Please help!!!
@glebshymko
@glebshymko 3 жыл бұрын
Hi, you need add Kotlin Android Extensions to your gradle file.
@glebshymko
@glebshymko 3 жыл бұрын
put it in dependencies : apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' But also Kotlin Android Extensions are now deprecate.
@nipponetzel
@nipponetzel 3 жыл бұрын
@@glebshymko I dont remember right now how I fixed this problem but I did not with extensions. Thank you for the answer and suggestion I preciate that...
@MrSchloban
@MrSchloban 3 жыл бұрын
@@glebshymko Thank you! Been staring at my code for 1h wondering what when wrong
@megumin4625
@megumin4625 3 жыл бұрын
Anybody wondering why your viewbinding isn't working? Here's how to fix it -->>> 1. Set it in gradle -> (NOTE: this belongs under -> android { } , section) buildFeatures { viewBinding true } 2. Use LayoutNameBinding as the class to inflate from in onCreateViewHolder (as "LayoutName" suggests, you replace this with the name of your xml layout) val layoutInflater = LayoutInflater.from(parent.context) val binding = LayoutNameBinding.inflate(layoutInflater, parent, false) return MyViewHolder(binding) 3. Send the binding to the ViewHolder (update the viewholder to hold a reference to LayoutNameBinding type) inner class MyViewHolder(val binding: LayoutNameBinding) : RecyclerView.ViewHolder(binding.root) 4. Enjoy viewbinding in bind() method! (NOTE, you may need additional implement's or whatnot in gradle. You can google for those)
@jacksonhall4322
@jacksonhall4322 4 жыл бұрын
Great tutorial Phillip! The lesson is valuable and your narration is easy to understand. Thank you
@PhilippLackner
@PhilippLackner 4 жыл бұрын
Thank you, you're welcome!
@sdfewvdevvv
@sdfewvdevvv 3 жыл бұрын
Hello Phillip! Do you plan on creating a video about recyclerview in view binding?
@natnaelsisay1424
@natnaelsisay1424 9 ай бұрын
My understanding is alot better now, but am sure i will get back to it once more. Thanks mate
@mateuszczuba9684
@mateuszczuba9684 Жыл бұрын
Hi! Thanks for this tutorial! I have a question though (probably a noob question): how can you access e.g. the rvTodos and its properties directly inside the main class? Same question for e.g. the tvTitle inside the TodoAdapter class. To access these have to first declare a val and find the needed object by id (e.g. val tvTitle = findViewById(R.id.tvTitle)).
@WisdomWhisper933
@WisdomWhisper933 Жыл бұрын
In LayoutInflater function why attachToRoot parameter in need if its always going to be false??
@harshmore6664
@harshmore6664 4 жыл бұрын
Amazing , detailed and easy to understand , thank you so much
@TheImaginativeSachin
@TheImaginativeSachin 2 жыл бұрын
Wow this is really step by step love this.
@thecoder9193
@thecoder9193 3 жыл бұрын
I'm really thankful to you . This tutorial is very easy to understand and learn recycle view.
@TefkrosAirliner
@TefkrosAirliner 4 жыл бұрын
Thank you Sir! Better than my lecturer's explanation
@ZombeeStar
@ZombeeStar Жыл бұрын
if i had a delete button on the template then how would i attach a function to each one?
@stephanvanellewee1653
@stephanvanellewee1653 2 жыл бұрын
Wow, this is such an elegant tutorial! Thank you!
@Domo22xD
@Domo22xD 2 жыл бұрын
Also there is problem on 20:21. You need add RecyclerView, Button and TextView to use it. So in your MainActivity add code like this. CODE: override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) var todoList = mutableListOf( ToDo("Text",false) ) // This was added val rv = findViewById(R.id.rvTodos) as RecyclerView val btnAddTodo = findViewById(R.id.btnAddTodo) as Button val etTodo = findViewById(R.id.etTodo) as TextView val adapter = ToDoAdapter(todoList) rv.adapter = adapter rv.layoutManager = LinearLayoutManager(this) btnAddTodo.setOnClickListener{ val title = etTodo.text.toString() val todo = ToDo(title,false) todoList.add(todo) adapter.notifyItemInserted(todoList.size - 1) } } Enjoy
@DanielTobi00
@DanielTobi00 Жыл бұрын
Thanks man.
@ronaldotiego
@ronaldotiego Жыл бұрын
When I run my app, I get Dublicate Classes error. What could be the problem please
@shivamparimalbhaigohel6632
@shivamparimalbhaigohel6632 2 жыл бұрын
Amazing Tutorial. Keep up the good work man!
@Indently
@Indently 4 жыл бұрын
Really helpful tutorial! Could I ask you if you know any places online where I could really dive deep into recycler views?
@PhilippLackner
@PhilippLackner 4 жыл бұрын
Thanks a lot! Take a look at codinginflow's channel, he has two new videos about recyclerview which I think are very detailed. I'm sure you can also find some good medium articles about recyclerviews
@Zeresrail
@Zeresrail 3 жыл бұрын
I wonder if you will answer my question - following your guide, for some reason the itemview does not show any of the views (like title etc) (in the apply part). As if it doesnt know them. Cant find a solution to this issue or why it is happening.
@Madjber
@Madjber 3 жыл бұрын
i have the same problem , any solution ??
@Zeresrail
@Zeresrail 3 жыл бұрын
@@Madjber I defined the fields in the holder inner class, finding them by Id, and accessed them that way.
@fuadydheo3155
@fuadydheo3155 4 жыл бұрын
good dude, fundamental is important, awesome!!
@PhilippLackner
@PhilippLackner 4 жыл бұрын
Thank you!
@simasbutavicius8485
@simasbutavicius8485 3 жыл бұрын
Thank you. The way you explain things, it's really easy to follow for newbies like me - very good job!
@TheImaginativeSachin
@TheImaginativeSachin 2 жыл бұрын
Hey how can i remove the todo list after i check the checkbox?
@marcw6875
@marcw6875 2 жыл бұрын
I'm having one problem with this tutorial. I don't know if anyone will reply in time to help me with this assignment, but I'll throw it out there in case anyone in the future has the same problem. In the adapter class, in the onBindViewHolder function, I tried using the same method to set the text in my recycler view, but I'm getting "unresolved references." For an example, I have a line of code "forecast_date.text = forecastList[position].date" where forecast_date is the ID for that particular TextView in my forecast_list_item.xml file. That is highlighted in red with the unresolved reference. I see that your program added that import kotlinx statement when started coding this part, but I don't seem to have that option. Any ideas why it's not seeing my forecast_list_item.xml file?...
@xtd3000
@xtd3000 4 жыл бұрын
Thank you very much for this video, it was really easy to follow and understand. Your explanations are clear and concise :)
@rolinejohnaguilar7819
@rolinejohnaguilar7819 4 жыл бұрын
Thank you, this actually helped me to understand recycler view :D
@PhilippLackner
@PhilippLackner 4 жыл бұрын
Congrats, you're welcome :D
@abhirupamitra2895
@abhirupamitra2895 2 жыл бұрын
Hi, I am just starting out with the tutorials. I can see that the recycler view state/ items in the todo list are not save when I reopen the app. Is there a way to go about this?
@MonishKrishnaS
@MonishKrishnaS 3 жыл бұрын
Glad I find this video at the first. The only thing is when you add the todo, the text on the keyboard is still there. How to get the EditText to empty itself after adding? Is there any systematic way?
@brianryan4053
@brianryan4053 3 жыл бұрын
I have mutableListOf in red. Does anybody know how to fix this issue?
@prithvib8662
@prithvib8662 4 жыл бұрын
Awesome tut. Only feedback is to use the GUI to add textviews/buttons/etc. instead of adding them manually via the XML editor as it is easier for viewers to follow along and see the app come together
@illusion9423
@illusion9423 2 жыл бұрын
He said in a previous video he prefers to teach XML because it has way more options than what you see in the GUI
@Defense89
@Defense89 3 жыл бұрын
awesome video , simple exemple not to much in it , perfect to understand the basics of everything 5 star this!!!!!!!!!!! good job
@apiuagou9601
@apiuagou9601 7 ай бұрын
You are indeed the best teacher for this but I also noticed you didn't use the get function to get the individual items in your list item folder.Someone explain why
@haxificality
@haxificality Жыл бұрын
you're explanation was very detailed, but i found out this method was only possible in my case using a depreciated method of using 'kotlin-android-extensions' as plugin for gradle. i hope you can redo it in the new updated method as of 2023.
@AdityaDey424
@AdityaDey424 2 жыл бұрын
I add the layout in onCreateViewHolder method. But I can't access the components of this layout in onBindViewHolder method . Anyone please help me .......
@PiBou321
@PiBou321 3 жыл бұрын
Hi, first thank you for this tutorial ! Why do we put todos.size in the getItemCount function ? The number of items showed should be different from the total number of items of the list, no? I don’t understand where in the code the adapter takes into account the site of the user screen, can you help me to understand please?
@derekdevs
@derekdevs Жыл бұрын
This is fantastic. Thank you so much!
@arrayofsilicon
@arrayofsilicon 2 жыл бұрын
Very Clean Explaination Thanks
@rochmanramadhanichieftoira2695
@rochmanramadhanichieftoira2695 4 жыл бұрын
Awesome tutorial! Hello from Indonesia 😁
@Beatboxerskills
@Beatboxerskills 2 жыл бұрын
hey Phillip :) if you also had a Spinner with todo category how would you declare that in the data class?
@youssefkhaled1189
@youssefkhaled1189 Жыл бұрын
Thank you so much this was really simplified amazingly
@kratom82
@kratom82 3 жыл бұрын
do you have an idea how to build a recyclerview like the "contacts" in a standard phone? i have a large dataset via json and some items have a category lets say "bikes" and some have "cycles" .. item decoration seems the wrong choice :D
@qasimmir336
@qasimmir336 4 жыл бұрын
Hello mate. I have a question. I need to add RecyclerView to another activity do I need to create a new adapter and data class for the activity's RecyclerView or the same adapter can be used somehow? Waiting for your reply. Thank you.👍
@calibur5518
@calibur5518 3 жыл бұрын
hi just create 1 adapter then from your mainActivity pass it to any new Activity you want
@hasht7331
@hasht7331 3 жыл бұрын
Where is "rvTodoItems" coming from in the main activity????
@SirDanMartin
@SirDanMartin 3 жыл бұрын
do you have a video showing how you can use a button from within each recycler view?
@bigstrongrobot1330
@bigstrongrobot1330 2 жыл бұрын
what is """tvTitle""" ? it's not working and we didn't declare it before !!!
@durotimiemmanuel5840
@durotimiemmanuel5840 3 жыл бұрын
Thank you Philipp u are awesome all of the videos I have watched were top notch and easy to understand as well except for maybe this one. I didn't quite understand the whole thing about recycle view...can you please help me for am not so sure I can get a better place to learn than here? thanks in anticipation
@SeemantAggarwal
@SeemantAggarwal 4 жыл бұрын
AMAZING, ABSOLUTELY AMAZING TUTORIAL, Can you please zoom in your code? I code it alongside and sometimes find it difficult, also DO CALL YOUR MOM, It is important hahaha
@FelixEsUnDios
@FelixEsUnDios 2 жыл бұрын
I just died of cringe bro🥲
@moisesgomez7820
@moisesgomez7820 4 жыл бұрын
Hi Phillip, I hope you are well. I'm following your tutorial with my own example. I have two activities: MainAcitivity and CreateNoteActivity. I want to pass text from two EditTexts in CreateNoteActivity and display it in a RecyclerView in MainActivity. When I click in the Create Note button, the note is not display in the Main Activity. How I can fix this? Before, I try the same app but with an only one activity: MainActivity, and works fine. Now I have two activities and I don't achieve success yet. Please, any help will be gratefully.
@GeorgeTrialonis
@GeorgeTrialonis 2 жыл бұрын
Hi there! In MainActivity rvTodos is not identified. Anyone has an idea about how to fix it? I applied a suggestion posted below by someone who watched this video. This suggestion did not work for me. Also, in the the clicklistener Todo [line: Todo(title, false)] is not identified either. Thanks.
@PhilippLackner
@PhilippLackner 2 жыл бұрын
Back then we had a plugin called Kotlin synthetics which allowed us to call views directly. Nowdays, you'll need to get view references using either findViewById() or ViewBinding (preferred)
@faraday6521
@faraday6521 2 жыл бұрын
Hi Philipp is this playlist for beginners to android or for java devs transitioning to kotlin, cause i'm the former with just knowledge of kotlin bascis
@valarmorghulisx
@valarmorghulisx 4 жыл бұрын
i love you man! you are awesome!
@PhilippLackner
@PhilippLackner 4 жыл бұрын
Thank you ❤️
@МихаилПатин-е6п
@МихаилПатин-е6п 4 жыл бұрын
Right now cbDone.isChecked is not updated in todo item. When you create more items and scroll then changed cbDone will be set as default.
@mohyddineal-lahham7620
@mohyddineal-lahham7620 3 жыл бұрын
same prob here
@malcolmfarrelle8591
@malcolmfarrelle8591 3 жыл бұрын
great video but I'm struggling with undeclared "tvTitle" when trying to populate> override fun onBindViewHolder(holder: TodoViewHolder, position: Int). I checked, double and treble checked, everything is named correctly. Any ideas?
@megumin4625
@megumin4625 3 жыл бұрын
Check my comment on the video. You need to enable viewbinding. I just gave instructions.
@malcolmfarrelle8591
@malcolmfarrelle8591 3 жыл бұрын
@@megumin4625 thanks 👍 (I had added the required statement in the module grade script but at the wrong scope level)
@megumin4625
@megumin4625 3 жыл бұрын
@@malcolmfarrelle8591 The video doesn't show how to set it up, nor is it set up properly in the video. I honestly have NO IDEA HOW it even works for him. From what I see, it shouldn't even theoretically work. Perhaps this was an old way to do it that no longer works?
@malcolmfarrelle8591
@malcolmfarrelle8591 3 жыл бұрын
@@megumin4625 I happened to have it set in the module from a spinner tutorial I was following earlier. Turns out it was in the correct scope, so some other issue. I'm currently building a clone of the whole project from Philipp's GitHub, hopefully that will help
@josantosp77
@josantosp77 3 жыл бұрын
I'm struggling with that too. It seems like learning Android dev is 10x more difficult than it should be - everything is deprecated 6 months later, so in every course or tutorial you're basically fucked trying to solve issues you shouldn't have to while learning a new framework. As a consequence, what should be a 30min tutorial ends up taking me over 3 hours trying to figure out how to make the code work. It's absolutely frustrating.
@arthurmsiska3800
@arthurmsiska3800 2 жыл бұрын
I messed up somewhere, when I run the app, the ,list does not show up nor the recycler view item
@rhinokyanui2702
@rhinokyanui2702 2 жыл бұрын
Me too...Did you find a fix
@phamhung2263
@phamhung2263 4 жыл бұрын
Thanks so much, Philipp. I really love all your amazing videos. Could you please create a video about using advanced RecyclerView in Android (increase performance, best practice when using RecyclerView...). I think it will be useful for any Android Developer
@debayanghoshdastider
@debayanghoshdastider 3 жыл бұрын
Accessing the checkbox and text view using synthetics does not work anymore and to use ViewBinding we need the adapter class. I am confused here. Can you please make a video on this?
@johnpunzak8916
@johnpunzak8916 3 жыл бұрын
To avoid the synthetics, add the following to the inner class: init{ tvTitle = itemView.findViewById(R.id.tvTitle) cbDone = itemView.findViewById(R.id.cbDone) } Then refer to the items directly in onBindViewHolder, like this: override fun onBindViewHolder(holder: TodoViewHolder, position: Int) { holder.tvTitle.text = todos[position].title holder.cbDone.isChecked = todos[position].isChecked }
@saeedyaftian66
@saeedyaftian66 Жыл бұрын
thanks a lot you explain this unit very good
@mohamedzaarir1122
@mohamedzaarir1122 Жыл бұрын
does it save ? i mean if i close the app and open it again , does it save the ToDos that i added or not ?
@guestalt00
@guestalt00 3 ай бұрын
late 1 year and xml is outdated, and i know you already knew the answer, but the answer is "no", you need to write another code to save something to your phone.
@wowovanmbothen
@wowovanmbothen 4 жыл бұрын
You take the data from list in Main Activity (todolist), what if i want to take the data from some class? For example i have data class book that contain title, author, year released etc
@crateer
@crateer 4 жыл бұрын
Well then you take the items from the Book Class, store them in a list, and you're done =)
@АльфредАхметгалеев
@АльфредАхметгалеев 2 жыл бұрын
HI! How delete item (position) ?
@youcantbebored2988
@youcantbebored2988 3 жыл бұрын
If we search for the xml views in onBindViewHolder wont it search for the view for every item ? this is exactly why we have ViewHolder class, so that the activity don't have to search for the view for every item 😅😅correct me if i am wrong
@gangardarwagle8938
@gangardarwagle8938 4 ай бұрын
Why is that only first data is shown
@dluca182
@dluca182 2 жыл бұрын
the learning curve is steep on this one....
@dfmayes
@dfmayes 9 ай бұрын
Thanks for the video. Is the code on github?
@olayiwolaosho4989
@olayiwolaosho4989 4 жыл бұрын
Great video man Thanks for this Have a question The how does the view holder know the XML view item it should hold is gotten from the todoitemxml didn't see any reference to it Thanks 😊
@Anonymous-nx9fh
@Anonymous-nx9fh 3 жыл бұрын
The ViewHolderclass is a inner class of the Adapter so the viewholder can get the refernce from there . Hope this helps :)
@GiridharaSaiPavanKumarGurram
@GiridharaSaiPavanKumarGurram 4 жыл бұрын
Hey, Great tutorial Can you do a video on layout manager in recyclerview ?
@vuyaninxele2301
@vuyaninxele2301 3 жыл бұрын
recyclerviews do this for you
@jaywye
@jaywye 3 жыл бұрын
Thank you for this video. Very helpful.
@movie4u978
@movie4u978 4 жыл бұрын
why did u set android:height = 0dp ,
@celina6204
@celina6204 3 жыл бұрын
Great tutorial! I always look for your channel when I don't understand something in Android :) Can you do a video on ListAdapter please
@hanadanefa7837
@hanadanefa7837 4 жыл бұрын
how can i check like if the recyclerview is empty? so i can have a textview saying no todo list something like that
@PhilippLackner
@PhilippLackner 4 жыл бұрын
Either check if the list in the adapter is empty or use its layout manager to check if no items are visible. I would prefer the first option
@hanadanefa7837
@hanadanefa7837 4 жыл бұрын
@@PhilippLackner hello thank you for giving time in my question, I am having difficulties in data class that I want to put in recyclerview, I want to ask how can I make the data class into null? or no value at all or just say I don't want to have a default value on it, I want it to be dynamic? how can I do that using data class?
@hanadanefa7837
@hanadanefa7837 4 жыл бұрын
@@PhilippLackner How can I set that mutablelist to empty? then add value to the todoList mutablelistof Todo() dynamically, like what you did in the button? I don't want to have a value on it, what I want is I am the one to set the value, like adding value from a button.
@ajaygalagali5963
@ajaygalagali5963 4 жыл бұрын
Great explanation! Thanks
@arthurdiarealvares4829
@arthurdiarealvares4829 3 жыл бұрын
Thank you very much man!!!
@jjongim3956
@jjongim3956 4 жыл бұрын
great lecture! Thank You!!
@agp1444
@agp1444 3 жыл бұрын
good explanation. thanks
@51bpegasi
@51bpegasi 3 жыл бұрын
You're an amazing teacher, been watching a lot of your tutorials. I just downloaded Android Studio 4.2.1 and I got stuck at 17:14 because it doesn't see tvTitle, I tried Megumin's proposed fix but doesn't seem to work for me build.gradle (Module: ...) android { ... buildFeatures { viewBinding true } ...} package com.tutorial.recyclerviewtutorial import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import com.tutorial.recyclerviewtutorial.databinding.ItemTodoBinding class ToDoAdapter(var todos: List): RecyclerView.Adapter() { inner class TodoViewHolder(val itemView: ItemTodoBinding): RecyclerView.ViewHolder(itemView.root) override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TodoViewHolder { val inflater = LayoutInflater.from(parent.context) val view = ItemTodoBinding.inflate(inflater, parent, false) return TodoViewHolder(view) } override fun onBindViewHolder(holder: TodoViewHolder, position: Int) { holder.itemView.apply { tvTitle.text = todos[position].title // tvTitle is unresolved reference here } } override fun getItemCount(): Int { return todos.size } Not sure how to fix this to continue.
@51bpegasi
@51bpegasi 3 жыл бұрын
oh wait, itemView seems to be reserved, works when i change it to itemview
@martianly808
@martianly808 3 жыл бұрын
same question.How to fix?
@olafpl99999
@olafpl99999 2 жыл бұрын
@@51bpegasi Didnt fix it for me, can you elaborate on your solution?
@matthewkilmurray8437
@matthewkilmurray8437 2 жыл бұрын
is there a java version of this?
@ericpalmer4103
@ericpalmer4103 2 жыл бұрын
Your explanation is just wow! Could you pls bring a video on the same but in Java?
@bhupeshpattanaik7150
@bhupeshpattanaik7150 4 жыл бұрын
thanks a lot for this video, please let me know is their any video in which this is done via internet i.e. data is fetched from net
@PhilippLackner
@PhilippLackner 4 жыл бұрын
check my news app playlist
@bhupeshpattanaik7150
@bhupeshpattanaik7150 4 жыл бұрын
@@PhilippLackner 😀👍
@simonegli3622
@simonegli3622 4 жыл бұрын
This video helped me a lot! But everytime i restart the app the points on the list, that i added are gone, how can I keep them(bc thats pretty much the point of a list, where you can write things down)
@PhilippLackner
@PhilippLackner 4 жыл бұрын
For that you need to save them to a database so they are not lost when the activity gets destroyed. Check out my MVVM Playlist for that. There I show exactly that
@ajaygalagali5963
@ajaygalagali5963 4 жыл бұрын
@@PhilippLackner I tried but unable to follow up! Too many things going on there.
@meghanabasutkar363
@meghanabasutkar363 3 жыл бұрын
Loved it!
@nicholastzane3466
@nicholastzane3466 4 жыл бұрын
Very nice video. Could you also make a video focusing on Emulator Devices. For example in this tutorial my app worked by i got the error Emulator: socketTcpLoopbackClientFor: error: fd 69252 above FD_SETSIZE (32768) and I don't know how i can fix it.
@gdstardust
@gdstardust 4 жыл бұрын
Nice tutorial, how can i implement recyclerview with snapping on start?
@Marinakulichok
@Marinakulichok 4 жыл бұрын
Add this line to clean the text in the EditText after it was added, otherwise you can not understand whether text was added or not
@SaifAli-ij2xt
@SaifAli-ij2xt 4 жыл бұрын
just add the following one line code for that: etTodo.getText().clear()
@mrpi230
@mrpi230 4 жыл бұрын
thank you, you explain really well.
@PhilippLackner
@PhilippLackner 4 жыл бұрын
Thanks!
@lukalukovic5082
@lukalukovic5082 4 жыл бұрын
Can you tell me how to delete the item in recycler view
@PhilippLackner
@PhilippLackner 4 жыл бұрын
By deleting the item from your list in the activity and then calling adapter.notifyItemDeleted(deletedIndex)
@javieer
@javieer 4 жыл бұрын
Thanks so much for your help! You are kind of a heroe for me
@PhilippLackner
@PhilippLackner 4 жыл бұрын
People who write such comments like you are heroes for me 🙏
@tcpro0902
@tcpro0902 3 жыл бұрын
Hi, Thanks for the Demo. Where we can find the source code?
@prakashm5711
@prakashm5711 4 жыл бұрын
why this awesome video has less number of views.?
@navinkodam412
@navinkodam412 4 жыл бұрын
Nice one!
@PhilippLackner
@PhilippLackner 4 жыл бұрын
Thanks!
@shahbaztariq2837
@shahbaztariq2837 Жыл бұрын
Thanks bro!
@randy4443
@randy4443 4 жыл бұрын
What is 0dp mean?
@rochmanramadhanichieftoira2695
@rochmanramadhanichieftoira2695 4 жыл бұрын
Watch the ConstraintLayout Series again 😉 it means that the EditText(View) will stretch a whole layout when you link the dot to the parent/another view in horizontal/vertically
@4585329
@4585329 3 жыл бұрын
19:56 Did you ever ask your crush out Philipp?
@facucancian7875
@facucancian7875 9 ай бұрын
BEAUTIFUL
FRAGMENTS - Android Fundamentals
17:29
Philipp Lackner
Рет қаралды 339 М.
BOTTOM NAVIGATION VIEW - Android Fundamentals
16:53
Philipp Lackner
Рет қаралды 56 М.
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
BAYGUYSTAN | 1 СЕРИЯ | bayGUYS
36:55
bayGUYS
Рет қаралды 1,9 МЛН
Adapting Android apps for XR
28:46
Android Developers
Рет қаралды 2,2 М.
ViewModels & Configuration Changes - Android Basics 2023
18:46
Philipp Lackner
Рет қаралды 137 М.
RecyclerView | Everything You Need to Know
25:07
Practical Coding
Рет қаралды 147 М.
I've Used Jetpack Compose For 4 Years - Here's the Good and the Bad
16:12
Intents & Intent Filters - Android Basics 2023
25:36
Philipp Lackner
Рет қаралды 84 М.
PASSING DATA BETWEEN ACTIVITIES - Android Fundamentals
18:44
Philipp Lackner
Рет қаралды 48 М.
TOASTS AND CONTEXT - Android Fundamentals
16:51
Philipp Lackner
Рет қаралды 39 М.
Ускоряем работу RecyclerView. Лучшие практики оптимизации
2:01:23
Android Broadcast. Все об Андроид разработке
Рет қаралды 27 М.
Let, Also, Apply, Run, With - Kotlin Scope Functions
11:44
Philipp Lackner
Рет қаралды 99 М.
Python laid waste to my C++!
17:18
Sheafification of G
Рет қаралды 148 М.