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
AIエージェント時代のPlatform as a Product —— テックリードがPdMとして回す発見・導入・計測 / Platform as a Product in the AI Agent Era
toshi0607
0
200
LLMに渡さなかった仕事
nanaism
0
12k
AIに任せた品質は、誰が見立てるのか - AI時代のテストマネジメント
nakanao
3
3.1k
手を動かして実感する、Kiro が変える開発体験
inariku
0
360
地方移住と都心キャリアの両立は「金・時間・人」のリソースをフル活用すれば実現できる!〜Snowflake女子会 vol.8
snowwmn0824
0
120
2026-09-08 そのJavaモダナイゼーション、AIに丸投げで大丈夫?IBM Bobで変わる品質と効率
yutanonaka
1
200
Coil3を内部実装から読み解く~キャッシュ戦略とAVIF画像の描画〜/nikkei-tech-talk50
nikkei_engineer_recruiting
0
110
2026-09-18 gotanda.sre Terraformで複数環境作ったり、複数Stateに分割したりそれとTerragrunt / Terraform multi envs and multi states
masasuzu
4
750
データ_AIの事業の勝敗をわけるもの
nek0128
1
480
AI Native Platform Engineering 〜PlatformとAgileで“作る速さ”を“価値”へ〜
uya116
0
160
Amazon Bedrock Agents ClassicからAmazon Bedrock AgentCoreへ移行した際、ガードレール設定が2箇所に割れた話
matsunobu
0
110
Goodbye ShellScript, Hello File-based App
shunsock
0
1.1k
Featured
See All Featured
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1k
Into the Great Unknown - MozCon
thekraken
41
2.7k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Music & Morning Musume
bryan
48
7.4k
Heart Work Chapter 1 - Part 1
lfama
PRO
10
36k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
350
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
46k
Navigating Weather and Climate Data
rabernat
0
530
Crafting Experiences
bethany
1
350
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
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