RECYCLERVIEW - Android Fundamentals

RECYCLERVIEW - Android Fundamentals

Philipp Lackner

4 года назад

101,414 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Motivational Quotes
Motivational Quotes - 16.08.2023 18:06

In LayoutInflater function why attachToRoot parameter in need if its always going to be false??

Ответить
Shahbaz Tariq
Shahbaz Tariq - 16.08.2023 16:19

Thanks bro!

Ответить
Mohamed Zaarir
Mohamed Zaarir - 30.07.2023 17:45

does it save ? i mean if i close the app and open it again , does it save the ToDos that i added or not ?

Ответить
Ohmega Tech
Ohmega Tech - 19.07.2023 05:59

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.

Ответить
alan bemalo
alan bemalo - 30.06.2023 00:42

why kotlin :(

Ответить
Tiago Castro
Tiago Castro - 18.06.2023 12:59

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.

Ответить
Rondroid
Rondroid - 29.05.2023 14:04

When I run my app, I get Dublicate Classes error. What could be the problem please

Ответить
Anatoli Tsoi
Anatoli Tsoi - 03.03.2023 21:04

Use my comment to express your sadness about onBindViewHoler in 2023 :(

Ответить
saeed yaftian
saeed yaftian - 23.02.2023 00:28

thanks a lot you explain this unit very good

Ответить
Youssef Tawfik
Youssef Tawfik - 05.02.2023 16:36

Thank you so much this was really simplified amazingly

Ответить
Tim Alj
Tim Alj - 05.02.2023 07:14

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.

Ответить
Tim Alj
Tim Alj - 05.02.2023 06:36

holder can't reference my view items inside the onBIndViewHolder. I can't import the item_todo.view. i can't find it.

Ответить
Derek Devs
Derek Devs - 21.01.2023 22:57

This is fantastic. Thank you so much!

Ответить
Zombee Star
Zombee Star - 10.01.2023 17:01

if i had a delete button on the template then how would i attach a function to each one?

Ответить
Ritesh Patel
Ritesh Patel - 18.11.2022 07:54

Succinct

Ответить
Альфред Ахметгалеев
Альфред Ахметгалеев - 17.11.2022 21:06

HI! How delete item (position) ?

Ответить
George Trialonis
George Trialonis - 06.11.2022 21:06

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.

Ответить
Sachin Timilsina
Sachin Timilsina - 20.10.2022 11:46

Hey how can i remove the todo list after i check the checkbox?

Ответить
Sachin Timilsina
Sachin Timilsina - 20.10.2022 10:17

Wow this is really step by step love this.

Ответить
faraday
faraday - 29.08.2022 13:16

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

Ответить
Abhirupa Mitra
Abhirupa Mitra - 27.08.2022 16:46

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?

Ответить
Jill Wark
Jill Wark - 31.07.2022 11:02

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

Ответить
dluca182
dluca182 - 18.07.2022 12:45

the learning curve is steep on this one....

Ответить
BigStrongRobot
BigStrongRobot - 28.06.2022 20:04

what is """tvTitle""" ? it's not working and we didn't declare it before !!!

Ответить
Ali
Ali - 13.06.2022 16:14

Clear explanation. Congrats !
Can you do updates as video or as comment under the video, because there are some deprecated usages.

Ответить
Arthur Msiska
Arthur Msiska - 09.06.2022 00:14

I messed up somewhere, when I run the app, the ,list does not show up nor the recycler view item

Ответить
ArrayOfSilicon
ArrayOfSilicon - 13.05.2022 16:40

Very Clean Explaination Thanks

Ответить
Shivam Parimalbhai Gohel
Shivam Parimalbhai Gohel - 08.05.2022 23:03

Amazing Tutorial. Keep up the good work man!

Ответить
Tấn Lộc
Tấn Lộc - 20.04.2022 06:56

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 🤘

Ответить
FATAHMORGANAH
FATAHMORGANAH - 09.03.2022 15:01

hey Phillip :) if you also had a Spinner with todo category how would you declare that in the data class?

Ответить
Matthew Kilmurray
Matthew Kilmurray - 01.03.2022 06:31

is there a java version of this?

Ответить
Marc W
Marc W - 05.02.2022 20:54

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?...

Ответить
Eric Palmer
Eric Palmer - 31.01.2022 10:40

Your explanation is just wow! Could you pls bring a video on the same but in Java?

Ответить
Stephan Van Ellewee
Stephan Van Ellewee - 21.01.2022 06:50

Wow, this is such an elegant tutorial! Thank you!

Ответить
Aditya Dey
Aditya Dey - 18.01.2022 15:37

I add the layout in onCreateViewHolder method. But I can't access the components of this layout in onBindViewHolder method . Anyone please help me .......

Ответить
William Selinder
William Selinder - 12.01.2022 12:05

Such a shame you do videos on Kotlin... you are very good at explaining.

Ответить
durotimi emmanuel
durotimi emmanuel - 16.12.2021 15:38

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

Ответить
# THE CODER
# THE CODER - 09.12.2021 22:10

I'm really thankful to you . This tutorial is very easy to understand and learn recycle view.

Ответить
Monish Krishna
Monish Krishna - 25.10.2021 15:40

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?

Ответить
Vasil Iv
Vasil Iv - 16.10.2021 21:13

Thank you Philipp, for the great tutorials! I follow the ANDROID FUNDAMENTALS FOR BEGINNERS and the tutorials are perfect so far.

Ответить
Simas Butavičius
Simas Butavičius - 17.09.2021 02:14

Thank you. The way you explain things, it's really easy to follow for newbies like me - very good job!

Ответить
Hash T
Hash T - 23.08.2021 22:57

Where is "rvTodoItems" coming from in the main activity????

Ответить
Haziq Haris
Haziq Haris - 16.08.2021 18:40

Thank youu !!

Ответить
Celina
Celina - 13.08.2021 16:21

Great tutorial! I always look for your channel when I don't understand something in Android :) Can you do a video on ListAdapter please

Ответить
paradigmaa
paradigmaa - 09.08.2021 19:55

good explanation. thanks

Ответить
Brian Ryan
Brian Ryan - 31.07.2021 23:19

I have mutableListOf in red. Does anybody know how to fix this issue?

Ответить
meghana basutkar
meghana basutkar - 25.07.2021 18:43

Loved it!

Ответить