[go: up one dir, main page]

0% found this document useful (0 votes)
49 views18 pages

DSC - Recycle View, DiffUtil and Many Other Things

A presentation on RecyclerViews and DiffUtils on Android. Link to app repository: https://github.com/DSC-Binus-KMG-2019/workshop5-final-class-5

Uploaded by

hugejunter27
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views18 pages

DSC - Recycle View, DiffUtil and Many Other Things

A presentation on RecyclerViews and DiffUtils on Android. Link to app repository: https://github.com/DSC-Binus-KMG-2019/workshop5-final-class-5

Uploaded by

hugejunter27
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Recycle View and

DiffUtil
And many other things!
More Android!

Bina Nusantara Kemanggisan


RecyclerView
A RecyclerView is used to repeat views and to display dynamic lists.
RecyclerView are made up of a few components
● Adapter
● Layouts

Bina Nusantara Kemanggisan


Adapter
Adapters are used to manage data in the RecyclerView
Adapters usually have methods of binding data to the RecyclerView layout

Bina Nusantara Kemanggisan


Layout
Layouts are the design of the RecyclerView.
Layouts are designed for a single list item, and will be repeated for each data.

Bina Nusantara Kemanggisan


DiffUtil
DiffUtils are used in RecyclerViews to add new items to
the dynamic list. It’s main purpose is to differentiate between
the old and the new RecyclerView list and update it accordingly

Bina Nusantara Kemanggisan


Dictionary
A dictionary is a class made for the purpose of list management.
Dictionaries usually contain methods of getting the list data or generate data.

Bina Nusantara Kemanggisan


ViewHolder
ViewHolders are usually in RecyclerView Adapters and
is a part of the adapter that is going to bind data to the layout.

Bina Nusantara Kemanggisan


Today is going to be quite
straightforward...

Bina Nusantara Kemanggisan


Today we are going to continue...

Bina Nusantara Kemanggisan


Bina Nusantara Kemanggisan
We are going to make...

Bina Nusantara Kemanggisan


Bina Nusantara Kemanggisan
Code Highlight
DiffUtil.calculateDiff(DiffUtilCallback)
calculateDiff is a command to get the difference between lists.

● DiffUtilCallback is a separate class that has methods


to differentiate between lists and extends
DiffUtil.Callback

Bina Nusantara Kemanggisan


Link to This Week’s Repo
https://github.com/DSC-Binus-KMG-2019/workshop5-final

Bina Nusantara Kemanggisan


Link to This Week’s Class Repo
https://github.com/DSC-Binus-KMG-2019/workshop5-final-class-5

Bina Nusantara Kemanggisan


References
https://developer.android.com/reference/android/support/v7/util/DiffUtil

Bina Nusantara Kemanggisan


that’s all for today folks!

Bina Nusantara Kemanggisan

You might also like