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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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.4k
retty-tech-cafe-8
yuyakaido
0
210
mti-eureka-tech-beer
yuyakaido
0
510
Other Decks in Programming
See All in Programming
FastAPI の並行処理モデルを完全に理解する
hoto17296
9
3.8k
新卒PdEのリアル
ryu1013
1
420
Can LLMs Replicate 4 Years of Compose Migration? Exploring the boundaries of automation with 279 XML files from a real product
makun
0
130
Pythonの実行はどこまで賢くなったのか? CPythonとPyPyから見る最適化のしくみ
curekoshimizu
4
2.8k
AI時代に学ぶ 好きなルール 嫌いなルール Linter編
shorty5121
0
870
AWS Step Functions 大規模並列の壁を越える / jaws-sonic-2026-niigata-step-functions
kasacchiful
PRO
0
390
AI に Inclusive UI を書かせよう — Design Rules Skill で Compose UI を作り直す
theoriatec2024
1
460
{ Android | Kotlin } Gradle Plugin in 2026
ryunen344
1
290
週末にAI-DLCを本気で回したら$1,600溶けた
hbashimizu
0
130
コンパウンドプロダクト開発のためのローカルプロセスマネージャー再発明 #layerxgo
izumin5210
0
660
Oxlintはいいぞ(続)
yug1224
1
550
Swift愛好会と私(ウホーイ) / Swift Fan Club and Uhooi
uhooi
0
140
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1369
210k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
320
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
290
The Cult of Friendly URLs
andyhume
79
7k
A designer walks into a library…
pauljervisheath
211
25k
So, you think you're a good person
axbom
PRO
2
2.1k
We Are The Robots
honzajavorek
0
350
Deep Space Network (abreviated)
tonyrice
0
290
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
65k
Darren the Foodie - Storyboard
khoart
PRO
3
3.9k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
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