DiffUtil - Improve RecyclerView's Performance | Android Studio Tutorial

Поделиться
HTML-код
  • Опубликовано: 24 ноя 2024

Комментарии • 59

  • @durbie90
    @durbie90 3 года назад +2

    Please do not stop making videos!! Your content is gold to me. I am learning so much from you.

  • @bjugdbjk
    @bjugdbjk 3 года назад +6

    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 года назад +7

    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.

  • @RonaldoGuedes
    @RonaldoGuedes 2 года назад +1

    Perfect!!! On a platter my recycler view get animated! so fluid! so fast!

  • @vuanhduong7034
    @vuanhduong7034 3 года назад +1

    Another component to improve my project. Thank you so much

  • @HalimCode
    @HalimCode 3 года назад +2

    Lots of loves from Afghanistan...😘🇦🇫

    • @catman4001
      @catman4001 2 года назад

      u have internet dude ?? just curious : )

  • @スヘア
    @スヘア 3 года назад

    You just read my mind. I was about to search for this video. Thank you

  • @mayx8844
    @mayx8844 2 года назад

    Thank you very much, bro, your material saved me at least two working days for 10 minutes :)

  • @shiden16
    @shiden16 3 года назад

    Thanks sir, i love watch your tutorials its gold (sry for my bad english)

  • @ПавелЗубко-ц8ч
    @ПавелЗубко-ц8ч 3 года назад +1

    Thank you very much everything worked out without question

  • @galihindrafirmansyah1283
    @galihindrafirmansyah1283 2 года назад

    thanks my fellow developer

  • @deepakprajapati5064
    @deepakprajapati5064 Год назад

    Thanks for the clean code and understanding.

  • @TharinduDanushke
    @TharinduDanushke Год назад

    Its really helpful & greate explanation

  • @haseeb776
    @haseeb776 5 месяцев назад

    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?

  • @mdforkan2012
    @mdforkan2012 2 года назад +1

    You are the best 😍

  • @farhad9579
    @farhad9579 3 года назад

    great topic well done ty

  • @kisan_thapa
    @kisan_thapa 3 года назад +5

    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 года назад +5

      It's purely for tutorial purpose. That way people will better understand how comparison is working behind the scenes.

    • @kisan_thapa
      @kisan_thapa 3 года назад +3

      @@StevdzaSan Thank you for reply. I discovered your channel this morning. I am loving your videos, keep posting videos regularly.❤️❤️

  • @ilhamaliyudin4779
    @ilhamaliyudin4779 3 года назад

    Ohh this is Im waiting for

  • @elaheshiri3284
    @elaheshiri3284 3 года назад

    So so good!! you are the One! thumb up of course Thank you!!!

  • @sholagebeya2863
    @sholagebeya2863 3 года назад

    You are the best.
    I love you. ❤️

  • @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]

  • @dartdeveloper
    @dartdeveloper 3 года назад +1

    Very good

  • @abada-s
    @abada-s 3 года назад

    very powerful thanks

  • @Berryss
    @Berryss 3 года назад +1

    Isnt this example the same as NotifyItemChanged and you pass the latest position on the list?

  • @shoxruxquroqov5349
    @shoxruxquroqov5349 3 года назад +1

    Hi Thank you for video. RowLayoutBinding in the ViewHolder constructor didn’t work for me

  • @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) ?

  • @SaherAlSous-welcomes-you
    @SaherAlSous-welcomes-you 3 года назад

    Very Good... Bravo

  • @mikayils.8660
    @mikayils.8660 3 года назад

    Thank you for all videos, Can you make a video about custom views ?

  • @Another0neTime
    @Another0neTime 3 года назад

    Real deal!!!

  • @quicksketch1617
    @quicksketch1617 3 года назад

    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 !!!

  • @akshaivsunil642
    @akshaivsunil642 3 года назад

    good one

  • @ivanguk10
    @ivanguk10 3 года назад

    Отличный канал, спасибо большое)

  • @yudhanjeffri8946
    @yudhanjeffri8946 3 года назад

    Hello Stevdza-San, i like your videos, i hope you can explain the Repository Pattern, Thanks

  • @mikemikee7797
    @mikemikee7797 3 года назад

    Can you cover also async list differ?

  • @MrRahulmalik
    @MrRahulmalik 3 года назад +1

    how about using ListAdapter

  • @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.

  • @easybusinessou
    @easybusinessou 3 года назад

    Great 🌹🌹🌹🌹🌹🌹🌹

  • @widcoshop
    @widcoshop 3 года назад +1

    Hi can you make it with java?

  • @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

  • @arseniykucherenko4960
    @arseniykucherenko4960 3 года назад

    Why don't we use Epoxy? It's already do this job for us without extra boiler plate code

  • @lara-kp7lp
    @lara-kp7lp 3 года назад

    If we have two data types what we have to do?

  • @jseh_
    @jseh_ 3 года назад

    it preserve position on the recyclerview?

  • @syedtayyabulmazhar6945
    @syedtayyabulmazhar6945 3 года назад

    Wouldn't it be easier to use ListAdapter?

  • @techstack1042
    @techstack1042 3 года назад

    What if when i add the person at index 0 ??

  • @nonetoro
    @nonetoro 3 года назад

    I run the app, but it's empty. How to make app shows content? Anyone knows? Thanks.

  • @anaskhalil4057
    @anaskhalil4057 2 года назад

    Can u open translate for your videos ?

  • @lowjungxuan6352
    @lowjungxuan6352 3 года назад

    can share the source code??

  • @deppakkumar659
    @deppakkumar659 3 года назад

    Why you have started the tutorials in Kotlin only why not Java.

  • @Mkumarei
    @Mkumarei 3 года назад

    🙂...

  • @lglf77
    @lglf77 10 месяцев назад

    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 года назад +1

    You are cool man. 🔥

  • @ILikeItPicasso
    @ILikeItPicasso 2 года назад

    Thanks man