Комментарии:
In LayoutInflater function why attachToRoot parameter in need if its always going to be false??
ОтветитьThanks bro!
Ответитьdoes it save ? i mean if i close the app and open it again , does it save the ToDos that i added or not ?
Ответить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.
Ответитьwhy kotlin :(
Ответить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.
ОтветитьWhen I run my app, I get Dublicate Classes error. What could be the problem please
ОтветитьUse my comment to express your sadness about onBindViewHoler in 2023 :(
Ответитьthanks a lot you explain this unit very good
ОтветитьThank you so much this was really simplified amazingly
Ответить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.
Ответитьholder can't reference my view items inside the onBIndViewHolder. I can't import the item_todo.view. i can't find it.
ОтветитьThis is fantastic. Thank you so much!
Ответитьif i had a delete button on the template then how would i attach a function to each one?
ОтветитьSuccinct
ОтветитьHI! How delete item (position) ?
Ответить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.
ОтветитьHey how can i remove the todo list after i check the checkbox?
ОтветитьWow this is really step by step love this.
Ответить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
Ответить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?
Ответитьthis is a snippet from my working recyclerview app (not related to this video)
when ur experiencing adapter not attached message at logcat, initialize RecyclerView variable at OnCreate() like the one shown below
private lateinit var binding:ActivityGameSaveBinding
private lateinit var itemRV: RecyclerView
(these variables are declared in Activity)
...
binding = ActivityGameSaveBinding.inflate(layoutInflater)
setContentView(binding.root)
...
itemRV = binding.gamesavelist
itemRV.setHasFixedSize(true)
itemRV.setLayoutManager(
LinearLayoutManager(
this,
LinearLayoutManager.VERTICAL,
false
)
)
...
val itemAdapter = ItemAdapter(itemList as ArrayList<GameDAO>)
itemRV.setAdapter(itemAdapter)
hope it helps
the learning curve is steep on this one....
Ответитьwhat is """tvTitle""" ? it's not working and we didn't declare it before !!!
ОтветитьClear explanation. Congrats !
Can you do updates as video or as comment under the video, because there are some deprecated usages.
I messed up somewhere, when I run the app, the ,list does not show up nor the recycler view item
ОтветитьVery Clean Explaination Thanks
ОтветитьAmazing Tutorial. Keep up the good work man!
ОтветитьI post my code here for someone have problem with adapter. Hope it can be help you <3
1. In grade, you insert this line
buildFeatures {
viewBinding true
}
2. In Adapter
2.1. TodoViewHolder
class TodoViewHolder(val binding: ItemTodoBinding) : RecyclerView.ViewHolder(binding.root)
2.2 - onCreateViewHolder
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TodoViewHolder {
val binding = ItemTodoBinding.inflate(LayoutInflater.from(parent.context), parent, false)
return TodoViewHolder(binding)
}
2.3 - onBindViewHolder
override fun onBindViewHolder(holder: TodoViewHolder, position: Int) {
with(holder) {
with(todos[position]) {
binding.tvTitle.text = this.title
binding.cbDone.isChecked = this.isChecked
}
}
}
3. I believe that you can handle MainActivity by yourself 🤘
hey Phillip :) if you also had a Spinner with todo category how would you declare that in the data class?
Ответитьis there a java version of this?
Ответить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?...
Your explanation is just wow! Could you pls bring a video on the same but in Java?
ОтветитьWow, this is such an elegant tutorial! Thank you!
ОтветитьI add the layout in onCreateViewHolder method. But I can't access the components of this layout in onBindViewHolder method . Anyone please help me .......
ОтветитьSuch a shame you do videos on Kotlin... you are very good at explaining.
Ответить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
ОтветитьI'm really thankful to you . This tutorial is very easy to understand and learn recycle view.
Ответить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?
ОтветитьThank you Philipp, for the great tutorials! I follow the ANDROID FUNDAMENTALS FOR BEGINNERS and the tutorials are perfect so far.
ОтветитьThank you. The way you explain things, it's really easy to follow for newbies like me - very good job!
ОтветитьWhere is "rvTodoItems" coming from in the main activity????
ОтветитьThank youu !!
ОтветитьGreat tutorial! I always look for your channel when I don't understand something in Android :) Can you do a video on ListAdapter please
Ответитьgood explanation. thanks
ОтветитьI have mutableListOf in red. Does anybody know how to fix this issue?
ОтветитьLoved it!
Ответить