DiffUtil - Improve RecyclerView's Performance | Android Studio Tutorial

  Рет қаралды 32,774

Stevdza-San

Stevdza-San

Күн бұрын

Пікірлер: 59
@durbie90
@durbie90 3 жыл бұрын
Please do not stop making videos!! Your content is gold to me. I am learning so much from you.
@bjugdbjk
@bjugdbjk 3 жыл бұрын
This is one of the best recommended channel youtube done to me..such a great content, Thank you so much for your kind efforts.
@no_fb
@no_fb 3 жыл бұрын
Thanks! But if that's about optimization you may as well, in MyDiffUtil, 1) use count() instead of size for good practice, and 2) have a local variable to the list[position] items in the old and new list, not to accumulate the linear access cost for each comparison.
@HalimCode
@HalimCode 3 жыл бұрын
Lots of loves from Afghanistan...😘🇦🇫
@catman4001
@catman4001 2 жыл бұрын
u have internet dude ?? just curious : )
@RonaldoGuedes
@RonaldoGuedes 2 жыл бұрын
Perfect!!! On a platter my recycler view get animated! so fluid! so fast!
@kisan_thapa
@kisan_thapa 3 жыл бұрын
6:08 Why are you comparing each properties of Person Data Class? Kotlin Data class generates equals() function for us. So return oldList[oldItemPosition] == newList[newItemPosition] will be enough.
@StevdzaSan
@StevdzaSan 3 жыл бұрын
It's purely for tutorial purpose. That way people will better understand how comparison is working behind the scenes.
@kisan_thapa
@kisan_thapa 3 жыл бұрын
@@StevdzaSan Thank you for reply. I discovered your channel this morning. I am loving your videos, keep posting videos regularly.❤️❤️
@mayx8844
@mayx8844 2 жыл бұрын
Thank you very much, bro, your material saved me at least two working days for 10 minutes :)
@vuanhduong7034
@vuanhduong7034 3 жыл бұрын
Another component to improve my project. Thank you so much
@スヘア
@スヘア 3 жыл бұрын
You just read my mind. I was about to search for this video. Thank you
@TharinduDanushke
@TharinduDanushke Жыл бұрын
Its really helpful & greate explanation
@deepakprajapati5064
@deepakprajapati5064 Жыл бұрын
Thanks for the clean code and understanding.
@shiden16
@shiden16 3 жыл бұрын
Thanks sir, i love watch your tutorials its gold (sry for my bad english)
@ПавелЗубко-ц8ч
@ПавелЗубко-ц8ч 3 жыл бұрын
Thank you very much everything worked out without question
@StevdzaSan
@StevdzaSan 3 жыл бұрын
Great 👌
@galihindrafirmansyah1283
@galihindrafirmansyah1283 2 жыл бұрын
thanks my fellow developer
@haseeb776
@haseeb776 6 ай бұрын
Great explanation. I have static list of icons from drawable and i need to show them in recycler view but, recycler view lags on first load. Is there any workaround?
@Berryss
@Berryss 3 жыл бұрын
Isnt this example the same as NotifyItemChanged and you pass the latest position on the list?
@shoxruxquroqov5349
@shoxruxquroqov5349 3 жыл бұрын
Hi Thank you for video. RowLayoutBinding in the ViewHolder constructor didn’t work for me
@mdforkan2012
@mdforkan2012 3 жыл бұрын
You are the best 😍
@elaheshiri3284
@elaheshiri3284 3 жыл бұрын
So so good!! you are the One! thumb up of course Thank you!!!
@kostasmitsos5482
@kostasmitsos5482 3 жыл бұрын
hello ... what if we want to use diffutil with 2way dataBinging ... is it posible ? ... thank y for your great work !!!
@widcoshop
@widcoshop 3 жыл бұрын
Hi can you make it with java?
@MrRahulmalik
@MrRahulmalik 3 жыл бұрын
how about using ListAdapter
@paramvirsingh5640
@paramvirsingh5640 Жыл бұрын
TIP: you can just use the following code is your are using Kotln Data Classes since it already implment the comparsion for all the properties of a Class. override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int) = oldList[oldItemPosition] == newList[newItemPosition]
@marc988
@marc988 2 жыл бұрын
That's great, in local. but can we use this same function (DiffUtil) if our data (those for the recycle view) come from firebase / where several user can constantly be editing the list (adding new elements, for example) ?
@sholagebeya2863
@sholagebeya2863 3 жыл бұрын
You are the best. I love you. ❤️
@farhad9579
@farhad9579 3 жыл бұрын
great topic well done ty
@jseh_
@jseh_ 3 жыл бұрын
it preserve position on the recyclerview?
@mikemikee7797
@mikemikee7797 3 жыл бұрын
Can you cover also async list differ?
@mikayils.8660
@mikayils.8660 3 жыл бұрын
Thank you for all videos, Can you make a video about custom views ?
@rahmathidayat4797
@rahmathidayat4797 2 жыл бұрын
how to handle the case of saving data to local db by diffutil, because it is null if you follow this tutorial
@lara-kp7lp
@lara-kp7lp 3 жыл бұрын
If we have two data types what we have to do?
@Lucas-hh4oh
@Lucas-hh4oh 3 жыл бұрын
Instead of comparing each item's properties, wouldn't it be easier if we just use _return oldList[oldItemPos] == newList[newItemPos]_ in areContentTheSame method?
@syedtayyabulmazhar6945
@syedtayyabulmazhar6945 3 жыл бұрын
**EDIT** : I just learned that kotlin data class generates equals() method, so you are correct. This would just compare their address in memory. Suppose object o1 has an address 0xab and a name property whose value is "John Doe", and object o2 has an address 0xbc and a name property whose value is "John Doe". Now if you compare them like this : o1===o2, it will return false because 0xab != 0xbc. But if you were to compare them by their content which is the name property, then you can see that both objects have the same content i.e: o1.name is same as o2.name.
@SaherAlSous-welcomes-you
@SaherAlSous-welcomes-you 3 жыл бұрын
Very Good... Bravo
@abada-s
@abada-s 3 жыл бұрын
very powerful thanks
@techstack1042
@techstack1042 3 жыл бұрын
What if when i add the person at index 0 ??
@anaskhalil4057
@anaskhalil4057 2 жыл бұрын
Can u open translate for your videos ?
@nonetoro
@nonetoro 3 жыл бұрын
I run the app, but it's empty. How to make app shows content? Anyone knows? Thanks.
@dartdeveloper
@dartdeveloper 3 жыл бұрын
Very good
@ilhamaliyudin4779
@ilhamaliyudin4779 3 жыл бұрын
Ohh this is Im waiting for
@yudhanjeffri8946
@yudhanjeffri8946 3 жыл бұрын
Hello Stevdza-San, i like your videos, i hope you can explain the Repository Pattern, Thanks
@ivanguk10
@ivanguk10 3 жыл бұрын
Отличный канал, спасибо большое)
@syedtayyabulmazhar6945
@syedtayyabulmazhar6945 3 жыл бұрын
Wouldn't it be easier to use ListAdapter?
@arseniykucherenko4960
@arseniykucherenko4960 3 жыл бұрын
Why don't we use Epoxy? It's already do this job for us without extra boiler plate code
@quicksketch1617
@quicksketch1617 3 жыл бұрын
Thank you
@akshaivsunil642
@akshaivsunil642 3 жыл бұрын
good one
@easybusinessou
@easybusinessou 3 жыл бұрын
Great 🌹🌹🌹🌹🌹🌹🌹
@deppakkumar659
@deppakkumar659 3 жыл бұрын
Why you have started the tutorials in Kotlin only why not Java.
@lowjungxuan6352
@lowjungxuan6352 3 жыл бұрын
can share the source code??
@Another0neTime
@Another0neTime 3 жыл бұрын
Real deal!!!
@Mkumarei
@Mkumarei 3 жыл бұрын
🙂...
@lglf77
@lglf77 11 ай бұрын
Sad class. I imagined that it adds the new user at the top of the recyclerView list, and not at the end, by default the recyclerView already does this by adding it at the end of the recyclerView. Useless content.
@daddyofalltrades
@daddyofalltrades 3 жыл бұрын
You are cool man. 🔥
@ILikeItPicasso
@ILikeItPicasso 2 жыл бұрын
Thanks man
@StevdzaSan
@StevdzaSan 2 жыл бұрын
You're welcome!
RECYCLERVIEW - Android Fundamentals
24:58
Philipp Lackner
Рет қаралды 106 М.
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
Quando eu quero Sushi (sem desperdiçar) 🍣
00:26
Los Wagners
Рет қаралды 15 МЛН
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 18 МЛН
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН
ViewModel Explained - Android Architecture Component | Tutorial
8:27
Motion Layout in Action | Android Studio Tutorial
14:19
Stevdza-San
Рет қаралды 71 М.
Navigation Component - Android Studio Tutorial
12:11
Stevdza-San
Рет қаралды 179 М.
ViewModels & Configuration Changes - Android Basics 2023
18:46
Philipp Lackner
Рет қаралды 136 М.
Retrofit - Send a simple GET Request | Android Studio Tutorial
12:37
RecyclerView Android Studio Tutorial | 2024
13:33
Easy Tuto
Рет қаралды 124 М.
View Binding vs Data Binding - Explained | Android Development
5:09
The Basics - Kotlin Coroutines
10:44
Stevdza-San
Рет қаралды 89 М.
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН