Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
matching_dev1
Search
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
Code4Lib JAPANカンファレンス2026 開会挨拶 / Code4Lib JAPAN Conference 2026: Opening Remarks
ykiyota
0
330
Slack上でインフラをトラブルシュートする! Agentic Platform Engineeringの第一歩
teru0x1
2
460
ペアプロの価値はコードを書くことだけじゃない
codmoninc
PRO
0
160
Claude in Chrome 入門 / Introduction to Claude in Chrome
cielo1985
0
160
Sigmaで作る業務アプリ
kazushiro_honma
0
110
2026/09/10 Spring Bootから Jakarta EE/MicroProfileへの移行
megascus
0
310
AI活用の現在地、 ちゃんと見えてますか?/XPfest-2026
visional_engineering_and_design
0
180
GoCon2026 - Open Source, Open World
sanposhiho
3
3.1k
When Does a Local Qwen Start to Break
morshoto
0
200
2026-09-09 【sigma_ucj#1】Sigma を IaC 管理したい! / IaC for Sigma
civitaspo
0
110
Adaptive Warehouse を今すぐ導入すべき理由と迷ったときの判断基準
__allllllllez__
0
170
Tab5をRubyで動くパソコンにする
kishima
2
320
Featured
See All Featured
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.2k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
510
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Building AI with AI
inesmontani
PRO
1
1.2k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
510
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
Testing 201, or: Great Expectations
jmmastey
46
8.3k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
A better future with KSS
kneath
240
18k
Designing Powerful Visuals for Engaging Learning
tmiket
1
540
Context Engineering - Making Every Token Count
addyosmani
9
1.1k
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