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
potatotips-33
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Yuya Kaido
September 28, 2016
Programming
690
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
potatotips-33
Yuya Kaido
September 28, 2016
Transcript
13 slides
ϖʔδϯάͷ ঢ়ଶཧ͔Β։์͞Ε͍ͨ potatotips #33 yuyakaido
ࣗݾհ • ւ౻༏ʢ͔͍Ͳ͏Ώ͏ʣ • גࣜձࣾΤϨΧ • 1ͷΠϯλʔϯΛܦͯɺ20154݄ʹ৽ଔೖࣾ • ςετ͓͡͞Μ
yuyakaido yuyakaido
ϖʔδϯάͱʁ • ՃಡΈࠐΈ • Ϧετͷ࠷Լ෦ʹ౸ୡͨ͠ΒDBAPI͔Β࣍ ϖʔδͷσʔλΛಡΈࠐΜͰදࣔ͢Δ
ࠓճͷγφϦΦ • RecyclerView • ࠷Լ෦·Ͱ౸ୡͨ͠ΒAPI͔ΒσʔλΛऔಘ • औಘͨ͠σʔλΛ࠷Լ෦ʹՃ
࣮ͯ͠ΈΔ • εΫϩʔϧΛίʔϧόοΫͰड͚औΔ • RecyclerView#OnScrollListener • AbsListView#OnScrollListener • ࠷Լ෦·Ͱ౸ୡͨ͠ΒAPIΛୟ͘
εΫϩʔϧΠϕϯτ recyclerView.scrollEvents() .filter { RecyclerViewUtil.shouldPaginate(layoutManager) } .subscribe({ // Load next
page }) fun shouldPaginate(manager: LinearLayoutManager): Boolean { val totalItemCount = manager.itemCount - 1 val lastVisibleItemPosition = manager.findLastVisibleItemPosition() return totalItemCount == lastVisibleItemPosition } εΫϩʔϧͷݕ ࠷Լ෦ͷఆ
QA͞ΜͱͷΓऔΓ ΞΠςϜ͕ॏෳͯ͠දࣔ͞Ε·͢Ͷ ͦΜͳΘ͚ͳ͍Ζ ɾɾɾ ΄Μ·
Կނͳͷ͔ • ίʔϧόοΫ͕ԿݺΕ͍ͯΔ • Demo
ରॲํ๏ • ಡΈࠐΈதϑϥάΛ࣋ͭ • ϑϥάΛͲ͜ʹ͔࣋ͭ • Activity/FragmentͷϑΟʔϧυ • ཧ͢Δঢ়ଶ͕૿͑ΔͷΠϠ •
ΫϩʔδϟΛ͏ͱ͍͍ײ͡ʹཧͰ͖ΔͷͰ
ΫϩʔδϟͰͷঢ়ଶཧ fun getFetcher(category: Category): () -> Observable<List<Article>> { var isFetching
= false var offset = 0 return fun () = Observable.just(isFetching) .filter { !isFetching } .doOnNext { isFetching = true } .flatMap { repository.getArticles(category, offset) } .doOnNext { isFetching = false } .doOnNext { offset += it.size } } • ಡΈࠐΈதϑϥάͱΦϑηοτΛཧ • ಡΈࠐΈதʹୟ͍ͯԿى͜Βͳ͍ • Activity/Fragment͔ΒΈΔͱɺԿߟ͑ͣʹୟ͚OK
·ͱΊ • ϖʔδϯάͰಡΈࠐΈঢ়ଶΛཧ͢Δඞཁ͋Γ • ঢ়ଶΛΫϥεͷϑΟʔϧυͰཧͨ͘͠ͳ͍ • KotlinΛ͍ͬͯΔ߹ΫϩʔδϟΛɺJavaͷ ߹ແ໊ΫϥεΛ͏ͱͤʹͳΕΔ͔ • https://github.com/yuyakaido/Flow-Android
Thank you :) Credit: NASA Earth Observatory/NOAA NGDC
More Decks by Yuya Kaido
See All by Yuya Kaido
droidkaigi-2019
yuyakaido
7
5k
matching-dev-meetup-1
yuyakaido
1
250
minami-aoyama-night-6
yuyakaido
1
1.3k
eureka-meetup-10
yuyakaido
0
860
droidkaigi-2018
yuyakaido
4
6.3k
navitime-eureka-1
yuyakaido
0
120
droidkaigi-2017
yuyakaido
11
8.5k
retty-tech-cafe-8
yuyakaido
0
210
mti-eureka-tech-beer
yuyakaido
0
520
Other Decks in Programming
See All in Programming
自宅サーバはどこまで再現できるのか - Proxmox VE上のVM環境をIaCとバックアップで戻してみた
youto
0
450
Claude Code ハーネスDeep Dive – 君はどこまで制御する? -
takateeen_knj
6
6.3k
AIが実装を担う時代の「技術設計」と「チームマネジメント」
kamina_zzz
2
460
疎結合とは何か?ソフトウェア設計における結合バランスについて考える #phpcon_niigata
kajitack
2
430
エージェントの管理もエージェントに – herdr-core と自作バックログで作る司令塔 –
nearme_tech
PRO
2
160
AI Augmentation Techniques with Liberty
ivargrimstad
1
580
joyful-journey-spring-boot.pdf
hollycummins
0
130
TS 7.0 で baseUrl が使えなくなった今、パスエイリアスをどうするか
bicstone
2
850
あなたはMCPの機能を、まだ知らない。
4geru
1
740
将来の標準フォーマッター?ktfmtを深堀る
t45k
1
250
AI駆動TDD ― 2026年10月版
hrmstrsmgs
0
110
protojson における文字化けの扱い
kazuki1023
0
470
Featured
See All Featured
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Evolving SEO for Evolving Search Engines
ryanjones
0
380
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
640
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
370
Heart Work Chapter 1 - Part 1
lfama
PRO
11
37k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
73
43k
How STYLIGHT went responsive
nonsquared
100
6.4k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
370
It's Worth the Effort
3n
188
30k