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.4k
retty-tech-cafe-8
yuyakaido
0
210
mti-eureka-tech-beer
yuyakaido
0
510
Other Decks in Programming
See All in Programming
The Good Stuff, Not the Slop: Engineering High-Quality Android Apps with Modern AI Tooling
danybony
1
190
What We Talk About When We Talk About XP
m_seki
2
390
型解析で実現する Go の言語内 DSL / Conference に Go! タイムテーブルの歩き方 for Gophers
mazrean
0
130
Foundry Localでエージェント開発
seosoft
0
150
Seeing Through Serverless: Observability for AWS Lambda with ADOT and CloudWatch Application Signals
seike460
PRO
1
120
新卒PdEのリアル
ryu1013
1
420
標準パッケージに uuid が追加された 背景から見る Go らしい意思決定 / go_127_uuid_decision
convto
2
1.6k
AI に Inclusive UI を書かせよう — Design Rules Skill で Compose UI を作り直す
theoriatec2024
1
460
LLMは4年分のCompose移行を再現できるのか?実プロダクト279件のXMLで探る自動化の境界線
makun
0
440
AIの中の人になってみる
htkym
0
170
XHTMLが残したもの
yosuke_furukawa
PRO
2
420
Swift愛好会100回記念 第1回を振り返る
jollyjoester
0
120
Featured
See All Featured
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
310
Skip the Path - Find Your Career Trail
mkilby
1
220
A designer walks into a library…
pauljervisheath
211
25k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Paper Plane
katiecoart
PRO
2
53k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.8k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.3k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
290
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
45k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3k
Product Roadmaps are Hard
iamctodd
55
13k
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