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
matching_dev1
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Ryo.Nitami
November 14, 2018
Technology
290
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
matching_dev1
https://matching-dev-group.connpass.com/event/104675/
Ryo.Nitami
November 14, 2018
More Decks by Ryo.Nitami
See All by Ryo.Nitami
20220927_mot_kauche_tummy
bird_tummy
0
150
Chucker で GraphQL の通信ログを見やすくした / Made GraphQL log easier to read on Chucker
bird_tummy
1
1.1k
dxel1
bird_tummy
0
4.1k
GraphQL in production
bird_tummy
3
3.6k
livedata-plus-viewmodel
bird_tummy
0
3.7k
何も準備せずにノリで上海に行ったら大変だった話 / shanghai-is-wonderful
bird_tummy
0
440
AutoLayout と友達になる方法 / How to be friends with AutoLayout
bird_tummy
1
3.2k
初めて転職して思ったこと / ngineerxiv11
bird_tummy
0
410
"DO NOT translate when you talk or listen" を実現するためにやっていること / clem6
bird_tummy
2
210
Other Decks in Technology
See All in Technology
本番に近いテストをもっと手軽に - Postmanで広がるAPIテストの世界 / Expanding the World of API Testing with Postman
yokawasa
1
130
8bit CPU 2026
koba789
7
3k
パスキーでドライブする アカウント統合(OAuth/OIDC Numa (Immersion) Workshop 2026)
oidfj
PRO
0
360
『自分で判断できるか』を基準に、プロダクトのハンズオン研修でAI利用の線を引いてみた / Where We Drew the Line on AI in Hands-on Training
honyanya
1
440
全社に広がるMCPサーバーを、 どう安全に管理するか MCPass開発の舞台裏
mtpooh
3
180
Distributed Transactions Under Fire: Building a Zero-Oversell Flash Sale Platform with Amazon Aurora DSQL
yama3133
1
110
ClaudeCodeでセキュリティ監視業務を半自動化_1年の運用でわかったAIに任せる設計の5つのポイント
kintotechdev
3
900
RapidCopy2 Matrix I/Oエンジンによるファイルコピーソフトウェアの設計と実装
kengosawa2
1
480
The Django UUID Story - DjangoCon US 2026
pauloxnet
0
310
PdMをやめて、 "プロダクトビルダー"という 働き方に変えました / PdM to Product Builder
shikichee
1
130
指示待ちから変化に応じるClaude Codeへ!~環境からAgentへの帰り道を作る~
gotalab555
8
1.6k
EMの役割で 変わったこと・変わらなかったこと
sansantech
PRO
1
190
Featured
See All Featured
Facilitating Awesome Meetings
lara
57
7.1k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.4k
Speed Design
sergeychernyshev
33
2k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
450
The World Runs on Bad Software
bkeepers
PRO
72
12k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
670
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
430
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
430
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
Balancing Empowerment & Direction
lara
6
1.3k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
800
Transcript
Paging Library ʹ͓͚ΔΞΫγϣϯΛ ϑοΫʹͨ͠Ϧετߋ৽ 2018/11/14 Matching Dev Meetup: iOS /
Android Paging Library ʹ͓͚ΔΞΫγϣϯΛϑοΫʹͨ͠Ϧετߋ৽ 1
Who? — Ryo Nitami — Android Application Engineer @ playmotion,
Inc. — Twitter: bird_tummy — GitHub: rnitame Paging Library ʹ͓͚ΔΞΫγϣϯΛϑοΫʹͨ͠Ϧετߋ৽ 2
Ϋϩεϛʔ — "͢Εҧ͍Λ࿀ͷ͖͔͚ͬʹ" — ҐஔใΛͬͨϚονϯάαʔϏε — 10/30 ʹ Android ΞϓϦΛϑϧϦχϡʔΞϧ͠·ͨ͠ʂ
— Architecture Components ΓΓ + Kotlin 100% — ͜Ε͔ΒΞοϓσʔτ͕ΜΓ·͢ Paging Library ʹ͓͚ΔΞΫγϣϯΛϑοΫʹͨ͠Ϧετߋ৽ 3
Paging Library — 2017 ͷ I/O Ͱൃද͞ΕͨɺϖʔδϯάʹಛԽͨ͠ϥΠϒ ϥϦ — "The
Paging Library makes it easier for you to load data gradually and gracefully within your app's RecyclerView." — 2018/11/14 ݱࡏɺ2.1.0-beta01 Paging Library ʹ͓͚ΔΞΫγϣϯΛϑοΫʹͨ͠Ϧετߋ৽ 4
Paging Library ʹ͓͚ΔΞΫγϣϯΛϑοΫʹͨ͠Ϧετߋ৽ 5
ΫϩεϛʔͰͷར༻ྫ — Ϧετʹͳ͍ͬͯΔͱ͜Ζ͢ ͯ Paging Library Paging Library ʹ͓͚ΔΞΫγϣϯΛϑοΫʹͨ͠Ϧετߋ৽ 6
ΞΫγϣϯΛϑοΫʹͨ͠Ϧετߋ ৽ — ඇදࣔϢʔβʔϦετͳͲ — ʮϘλϯΛԡ͢ → API Λୟ͘ →
View Λߋ৽͢Δʯͱ͍͏ྲྀΕ͕ ༷ʑͳ໘Ͱൃੜ Paging Library ʹ͓͚ΔΞΫγϣϯΛϑοΫʹͨ͠Ϧετߋ৽ 7
·ͬͨͱ͜Ζ — PagedList ཁૉͷՃߋ৽ɺআ͕Ͱ͖ͳ͍ Paging Library ʹ͓͚ΔΞΫγϣϯΛϑοΫʹͨ͠Ϧετߋ৽ 8
PagedList ཁૉͷՃߋ৽ɺআ͕Ͱ͖ͳ͍ — issue tracker Ͱʮόά͡Όͳͯ͘ػೳ͕Γ͍ͯͳ͍ͩ ͚ͩʂʯͱ͍͏͕ٞ1 1 https://issuetracker.google.com/issues/74916992 Paging
Library ʹ͓͚ΔΞΫγϣϯΛϑοΫʹͨ͠Ϧετߋ৽ 9
PagedList MutableList Ͱͳ͍ʂ — googlesamples ͷ issue Ͱ Room
͓ͬͯίϝϯτ͕ ͋Δ2 — ΫϩεϛʔͰ͜ͷํ๏ͰରԠ 2 https://github.com/googlesamples/android-architecture-components/issues/281 Paging Library ʹ͓͚ΔΞΫγϣϯΛϑοΫʹͨ͠Ϧετߋ৽ 10
Room ܦ༝ͰϦετදࣔ Paging Library ʹ͓͚ΔΞΫγϣϯΛϑοΫʹͨ͠Ϧετߋ৽ 11
class UserBoundaryCallback( private val helper: UserPagingRequestHelper ) : PagedList.BoundaryCallback<User>() {
@MainThread override fun onZeroItemsLoaded() { } @MainThread override fun onItemAtFrontLoaded(itemAtFront: User) { } @MainThread override fun onItemAtEndLoaded(itemAtEnd: User) { super.onItemAtEndLoaded(itemAtEnd) // API Λୟ͍ͯ get data helper.loadAfterIfNotRunning(before = itemAtEnd.time) } } Paging Library ʹ͓͚ΔΞΫγϣϯΛϑοΫʹͨ͠Ϧετߋ৽ 12
@Dao interface UserDao { @Query("SELECT * FROM users") fun allUsers():
DataSource.Factory<Int, User> @Insert(onConflict = OnConflictStrategy.REPLACE) fun save(users: List<User>): List<Long> } Paging Library ʹ͓͚ΔΞΫγϣϯΛϑοΫʹͨ͠Ϧετߋ৽ 13
private val config = PagedList.Config.Builder() .setEnablePlaceholders(false) .setInitialLoadSizeHint(LOAD_COUNT) .setPageSize(LOAD_COUNT) .build() private
val helper = UserPagingRequestHelper().start() // ͜ͷ LiveData Λ Activity / Fragment Ͱ observe ͯ͠ submitList val users = LivePagedListBuilder(userDatabase.dao().allUsers(), config) .setBoundaryCallback(UserBoundaryCallback(helper)) .setFetchExecutor(executor) .build() fun updateUsers() { // DB ʹอଘ } fun deleteUser(userId: Long) { // DB ͷϢʔβʔΛߋ৽ͭͭ͠ɺ֘ API ୟ͘ } Paging Library ʹ͓͚ΔΞΫγϣϯΛϑοΫʹͨ͠Ϧετߋ৽ 14
·ͱΊ — Paging Library ͱ Room ΛͬͯɺΞΫγϣϯΛϑοΫʹ ͨ͠Ϧετߋ৽ͷ࣮Λͨ͠ — PagedList
Λ͍͡ΕΕ͍͍ͳͱࢥ͏͕ɺPaging Library ࣗମͷׂΛߟ͑Δͱ͜͏͢Δͷ͕ࣗવʁ — ࠓޙͷΞοϓσʔτʹظ Paging Library ʹ͓͚ΔΞΫγϣϯΛϑοΫʹͨ͠Ϧετߋ৽ 15
͋Γ͕ͱ͏͍͟͝·ͨ͠ Paging Library ʹ͓͚ΔΞΫγϣϯΛϑοΫʹͨ͠Ϧετߋ৽ 16