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
1.8k
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
Jetpack ComposeのBottomSheetとの戦い / Fight with BottomSheet of Jetpack Compose
kubode
0
85
Mobile Chapterが目指すところと技術 / Vision and Technology of Mobile Chapter at Wantedly
kubode
0
110
ウォンテッドリーでのKMPワークフロー / KMP workflow at Wantedly
kubode
0
1k
ComposeでのShared Element Transition / Shared Element Transition in Compose
kubode
0
300
K2への完全移行結果 / Results of complete migration to K2
kubode
2
4.2k
Data Bindingの移行を楽にする / Easier migration of Data Binding
kubode
0
810
Compose Shadow Alternative
kubode
0
250
アイコンをComposeにする / Compose the Icons
kubode
0
440
デザインシステムのCompose実装 / Design system Compose implementation
kubode
0
510
Other Decks in Programming
See All in Programming
ピグパーティにおけるMongoDB CommunityバージョンからAtlasへの移行事例
10969hotaka
0
130
CSC307 Lecture 13
javiergs
PRO
0
150
ドメイン駆動設計の実践
masuda220
PRO
19
5.2k
Exploring the Gradually Lost Technical Skills in the Cloud Native Era
hwchiu
2
3.9k
12年前の『型システム入門』翻訳の思い出話
mame
11
1.2k
大規模マルチテナントを解決するYugabyteDBという選択肢
nnaka2992
1
250
AWSでゲームサーバーを運用! Amazon GameLiftのお話
iriikeita
0
200
CSC307 Lecture 14
javiergs
PRO
0
220
継続的な活動で築く地方エンジニアの道
myamashii
2
360
Xcode 16のPreviewModifierと@Previewableを活用した効率的なプレビュー方法の考察
ojun9
2
160
AHC035解説
terryu16
0
730
小さな開発会社を作った理由
polidog
0
1.9k
Featured
See All Featured
Producing Creativity
orderedlist
PRO
340
39k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
248
20k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
36
9.1k
GraphQLの誤解/rethinking-graphql
sonatard
59
9.6k
A Tale of Four Properties
chriscoyier
155
22k
Large-scale JavaScript Application Architecture
addyosmani
506
110k
Done Done
chrislema
179
15k
Building Your Own Lightsaber
phodgson
101
5.9k
Agile that works and the tools we love
rasmusluckow
325
20k
Fashionably flexible responsive web design (full day workshop)
malarkey
399
65k
Learning to Love Humans: Emotional Interface Design
aarron
269
39k
A Philosophy of Restraint
colly
200
16k
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