Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
DiffUtil and ListAdapter
Search
Masatoshi Kubode
April 19, 2018
Programming
0
2k
DiffUtil and ListAdapter
DiffUtil and ListAdapter
2018/04/19 potatotips 50
Masatoshi Kubode
April 19, 2018
Tweet
Share
More Decks by Masatoshi Kubode
See All by Masatoshi Kubode
ウォンテッドリーの「ココロオドル」モバイル開発 / Wantedly's "kokoro odoru" mobile development
kubode
2
1.1k
Firebase Dynamic Linksの代替手段を自作する / Create your own Firebase Dynamic Links alternative
kubode
0
570
技術を根付かせる / How to make technology take root
kubode
1
400
WantedlyでのKotlin Multiplatformの導入と課題 / Kotlin Multiplatform Implementation and Challenges at Wantedly
kubode
0
520
Google Play Consoleデベロッパー アカウントの確認 / Verifying your Play Console developer account
kubode
1
1.3k
Make your Android app into Multiplatform app
kubode
0
180
ウォンテッドリーにおけるモバイルアプリ開発 / iOSDC Japan 2024 Sponsor Session
kubode
1
1.2k
Jetpack ComposeのBottomSheetとの戦い / Fight with BottomSheet of Jetpack Compose
kubode
0
940
Mobile Chapterが目指すところと技術 / Vision and Technology of Mobile Chapter at Wantedly
kubode
0
380
Other Decks in Programming
See All in Programming
テーブル定義書の構造化抽出して、生成AIでDWH分析を試してみた / devio2025tokyo
kasacchiful
0
350
社会人になっても趣味開発を続けたい! / traPavilion
mazrean
1
120
When Dependencies Fail: Building Antifragile Applications in a Fragile World
selcukusta
0
120
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
110
SidekiqでAIに商品説明を生成させてみた
akinko_0915
0
110
O Que É e Como Funciona o PHP-FPM?
marcelgsantos
0
240
CSC305 Lecture 12
javiergs
PRO
0
250
Node-REDのノードの開発・活用事例とコミュニティとの関わり(Node-RED Con Nagoya 2025)
404background
0
110
React Nativeならぬ"Vue Native"が実現するかも?_新世代マルチプラットフォーム開発フレームワークのLynxとLynxのVue.js対応を追ってみよう_Vue Lynx
yut0naga1_fa
2
1.9k
EMこそClaude Codeでコード調査しよう
shibayu36
0
520
モテるデスク環境
mozumasu
3
1.4k
フロントエンド開発のためのブラウザ組み込みAI入門
masashi
7
3.6k
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
It's Worth the Effort
3n
187
28k
Testing 201, or: Great Expectations
jmmastey
46
7.7k
Speed Design
sergeychernyshev
32
1.2k
Why Our Code Smells
bkeepers
PRO
340
57k
Embracing the Ebb and Flow
colly
88
4.9k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
2.9k
Into the Great Unknown - MozCon
thekraken
40
2.1k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
34
2.3k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
127
54k
Product Roadmaps are Hard
iamctodd
PRO
55
11k
Transcript
©2018 Wantedly, Inc. DiffUtil and ListAdapter potatotips 50 19.Apr.2018 -
Masatoshi Kubode
©2018 Wantedly, Inc. Self introduction Masatoshi Kubode Twitter: @swiz_ard GitHub:
@kubode Qiita: @kubode Wantedly Visit UserGrowth
©2018 Wantedly, Inc. 1. DiffUtil 2. ListAdapter 3. Demo Agenda
©2018 Wantedly, Inc. DiffUtil
©2018 Wantedly, Inc. • Calculates the differences between 2 lists
• Detects change, insert, remove, move • Move detection is optional • O(n) • 1000 / 50 modifications 4.6ms on Nexus 5X DiffUtil
©2018 Wantedly, Inc. ListAdapter
©2018 Wantedly, Inc. • Added in support library 27.1.0 •
A RecyclerView.Adapter using DiffUtil • Just submitList(newItems) • Calculates the diff on a background thread • Notify diff results on the main thread ListAdapter
©2018 Wantedly, Inc. Demo ListAdapter
©2018 Wantedly, Inc. • Should not use with MutableList •
Does nothing if same instance submitted ListAdapter Important point
©2018 Wantedly, Inc. Conclusion
©2018 Wantedly, Inc. • DiffUtil automates the adapter notification •
Simplify around the adapter operations Conclusion
©2018 Wantedly, Inc. https://github.com/kubode/DiffUtil-sample Repository
©2018 Wantedly, Inc. Thanks