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
retty-tech-cafe-8
Search
Yuya Kaido
December 09, 2016
Programming
210
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
retty-tech-cafe-8
Yuya Kaido
December 09, 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
mti-eureka-tech-beer
yuyakaido
0
510
potatotips-33
yuyakaido
2
680
Other Decks in Programming
See All in Programming
Android CLI
fornewid
0
230
170k Jobs a Day on GKE: Scaling Mercari's CI Platform - and What's Next for AI-Native Development
junyaokabe
0
120
AIを紡ぐPMのお話
swdtkuy
0
120
楽しそうなつよつよエンジニアと目が死んでる僕/A brilliant engineer having a blast, and dead-eyed me.
3l4l5
2
200
まずはプロンプトガイドを読もう、話はそれからだ
kiakiraki
1
160
VibeCodingからAgenticWorkflowへ
starfish719
0
690
GDG Korea Android: 2026 I/O Extended ~ What's new in Android development tools
pluu
0
230
【デモ】Kiroで体験する仕様駆動開発|設計からコーディングまでAIと進める開発フロー
cmkudo
0
250
AI時代に設計が 最大の生産性レバーになる 意図駆動開発とデータを消さない設計|Don't Delete Your Data or Your Intent — Design as the Deepest Lever in the AI Era
tomohisa
1
1.1k
片田舎のおっさん、 Swift Buildのダイアモンド問題解決の不具合修正PRを出すが、解決方法がキャッシュをしないようにすることであり、ビルド時間が伸びると言われてマージされないので高速化もする/swiftbuild
yimajo
0
200
Cloudflare is Agents
chimame
0
170
テーブルをDELETEした
yuzneri
0
150
Featured
See All Featured
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
410
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Automating Front-end Workflow
addyosmani
1369
210k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
400
New Earth Scene 8
popppiees
3
2.5k
The agentic SEO stack - context over prompts
schlessera
0
870
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
420
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
GraphQLとの向き合い方2022年版
quramy
50
15k
RailsConf 2023
tenderlove
30
1.5k
Transcript
Kotlin × Data Binding Retty Tech Cafe #8 yuyakaido
ࣗݾհ • ւ౻༏ʢ͔͍Ͳ͏Ώ͏ʣ • גࣜձࣾΤϨΧ • 1ͷΠϯλʔϯΛܦͯɺ20154݄ʹ৽ଔೖࣾ yuyakaido yuyakaido
None
࣍ • Kotlin͔ΒBindingΫϥεͷࢀর • BindingΫϥε͕ࢀরͰ͖ͳ͍ • BindingAdapter • ΧελϜόΠϯσΟϯά͕ಈ͔ͳ͍
BindingΫϥε͕ࢀরͰ͖ͳ͍ • Kotlin͔ΒBindingΫϥεΛࢀর͢Δͱ • ίϯύΠϧॱɿKotlin → Java Unresolved reference:
databinding Unresolved reference: ItemArticleBinding Unresolved reference: ItemArticleBinding
ղܾࡦ • generateStubsΛ༗ޮʹ͢Δ • kotlin-kaptΛ͏
generateStubsΛ༗ޮʹ͢Δ • Kotlin → Java • Stub → Kotlin →
Java kapt { generateStubs = true }
kotlin-kaptΛ͏ • KotlinʹΑΔAnnotation Processing࣮ • apply plugin: ‘kotlin-kapt' • ؆୯ͳαϯϓϧಈ࡞͠·ͨ͠
The new annotation processing still has known issues and may not be compatible with all annotation processors. You should enable it only if you’ve run into problems with the default kapt annotation processing implementation.
ΧελϜόΠϯσΟϯά͕ಈ͔ͳ͍ • GlidePicassoΛͬͯImageViewʹURLΛό Πϯυ͢Δ public class CustomBinder { @BindingAdapter("app:imageUrl")
public static void imageUrl(ImageView imageView, String url) { Glide.with(imageView.getContext()).load(url).into(imageView); } } class CustomBinder { companion object { @BindingAdapter("app:imageUrl") fun imageUrl(imageView: ImageView, url: String) { Glide.with(imageView.context).load(url).into(imageView) } } }
ղܾࡦ • JvmStaticΞϊςʔγϣϯΛ༩͢Δ • ֦ுؔͱ࣮ͯ͢͠Δ
JvmStaticΞϊςʔγϣϯΛ༩͢Δ class CustomBinder { companion object { @JvmStatic @BindingAdapter("app:imageUrl")
fun imageUrl(imageView: ImageView, url: String) { Glide.with(imageView.context).load(url).into(imageView) } } } object CustomBinder { @JvmStatic @BindingAdapter("app:imageUrl") fun imageUrl(imageView: ImageView, url: String?) { Glide.with(imageView.context).load(url).into(imageView) } }
֦ுؔͱ࣮ͯ͢͠Δ @BindingAdapter("android:imageUrl") fun ImageView.imageUrl(url: String?) { Glide.with(context).load(url).into(this) }
·ͱΊ • BindingΫϥε͕Kotlin͔ΒࢀরͰ͖ͳ͍ • generateStubsΛ༗ޮʹ͢Δ • kotlin-kaptΛ͏ • ΧελϜόΠϯσΟϯά͕ಈ͔ͳ͍ •
JvmStaticΞϊςʔγϣϯΛ༩͢Δ • ֦ுؔͱ࣮ͯ͢͠Δ
ࢿྉɾαϯϓϧίʔυ • Kotlin×Data Bindingͷͱղܾ๏ • http://qiita.com/yuyakaido/items/ e5acf5f8ac31c4ed8c77 • https://github.com/yuyakaido/Flow-Android
Thank you :) Credit: NASA Earth Observatory/NOAA NGDC