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
potatotips-33
Search
Yuya Kaido
September 28, 2016
Programming
680
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
potatotips-33
Yuya Kaido
September 28, 2016
More Decks by Yuya Kaido
See All by Yuya Kaido
droidkaigi-2019
yuyakaido
7
4.9k
matching-dev-meetup-1
yuyakaido
1
240
minami-aoyama-night-6
yuyakaido
1
1.3k
eureka-meetup-10
yuyakaido
0
850
droidkaigi-2018
yuyakaido
4
6.2k
navitime-eureka-1
yuyakaido
0
110
droidkaigi-2017
yuyakaido
11
8.3k
retty-tech-cafe-8
yuyakaido
0
200
mti-eureka-tech-beer
yuyakaido
0
500
Other Decks in Programming
See All in Programming
「正の参照」と 「負の導出」で組む ハーネスエンジニアリング
cottpan
1
110
その問い、本当に正しいですか?AI時代のエンジニアに必要な哲学と認知科学 / ai-philosophy-cognitive-science
minodriven
14
6.6k
Developing with AI Agents — Codex, Claude Code & Cowork Practical Guide
x5gtrn
PRO
0
1.3k
技術記事、 専門家としてのプログラマ、 言語化
mizchi
14
7.2k
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
2.7k
TAKTでAI駆動開発の品質を設計する
j5ik2o
7
1.6k
なぜ型を書くのか? TSKaigi2026で改めて考える #tskaigi_smarthr
kajitack
0
190
The NotImplementedError Problem in Ruby
koic
1
1.1k
symfony/aiとlaravel/boost
77web
0
120
Vite+ Unified Toolchain for the Web
naokihaba
0
410
20260623_Loop Engineeringで自分の分身の問い合わせBotを作る
ryugen04
0
110
Even G2とAWSで推しのエージェントを召喚しよう!
har1101
1
140
Featured
See All Featured
We Have a Design System, Now What?
morganepeng
55
8.2k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
260
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.7k
Abbi's Birthday
coloredviolet
3
8.5k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
Deep Space Network (abreviated)
tonyrice
0
220
Scaling GitHub
holman
464
140k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.9k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
Transcript
ϖʔδϯάͷ ঢ়ଶཧ͔Β։์͞Ε͍ͨ 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