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
Play with Kotlin
Search
yoppie
March 25, 2019
Technology
1
600
Play with Kotlin
Kotlinで遊ぶ
yoppie
March 25, 2019
Tweet
Share
More Decks by yoppie
See All by yoppie
AmperとFleetを使ったAndroidアプリ
yoppie
0
850
Androidエンジニアが Flutterでアプリを リリースするまでの苦悩
yoppie
0
530
Navigation Component 実践編
yoppie
1
260
FragmentContainerViewとは
yoppie
0
730
Recent tips collection
yoppie
0
980
Distribute Android app updates with bitrise
yoppie
0
1.4k
EC2 using Lumen and DynamoDB and SNS
yoppie
1
260
sabotage
yoppie
1
940
Other Decks in Technology
See All in Technology
第4回 関東Kaggler会 [Training LLMs with Limited VRAM]
tascj
12
1.7k
Understanding Go GC #coefl_go_jp
bengo4com
0
1.1k
RAID6 を楔形文字で組んで現代人を怖がらせましょう(実装編)
mimifuwa
0
300
OpenAPIから画面生成に挑戦した話
koinunopochi
0
150
Amazon Bedrock AgentCore でプロモーション用動画生成エージェントを開発する
nasuvitz
6
420
JOAI発表資料 @ 関東kaggler会
joai_committee
1
260
DeNA での思い出 / Memories at DeNA
orgachem
PRO
3
1.6k
人を動かすことについて考える
ichimichi
2
320
[CV勉強会@関東 CVPR2025 読み会] MegaSaM: Accurate, Fast, and Robust Structure and Motion from Casual Dynamic Videos (Li+, CVPR2025)
abemii
0
190
実践アプリケーション設計 ③ドメイン駆動設計
recruitengineers
PRO
1
160
キャリアを支え組織力を高める「多層型ふりかえり」 / 20250821 Kazuki Mori
shift_evolve
PRO
2
300
LLMエージェント時代に適応した開発フロー
hiragram
1
410
Featured
See All Featured
How to Ace a Technical Interview
jacobian
279
23k
Unsuck your backbone
ammeep
671
58k
Gamification - CAS2011
davidbonilla
81
5.4k
Speed Design
sergeychernyshev
32
1.1k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.6k
Statistics for Hackers
jakevdp
799
220k
Building a Modern Day E-commerce SEO Strategy
aleyda
43
7.5k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.4k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
jQuery: Nuts, Bolts and Bling
dougneiner
64
7.9k
Transcript
KotlinͰ༡Ϳ
Facebook hi.kowaii.de / Twitter @yoppie_x Github yoshiya12X / Qiita yoppie_x
ϒϩά https://yoppiex.hatenablog.com/ yoppie
Kotlinͱͷग़ձ͍ ιϑτΣΞֶͷݚڀ AndroidΞϓϦͷιʔείʔυΛରͱ͍ͯͨ͠ ࣗͰͪΐͪ͜ΐ͜AndroidΞϓϦΛ࡞ͬͯͨ ֶ෦ େֶӃ
Kotlinͱͷग़ձ͍ KotlinΛॻ͖࢝ΊΔ (໊લ͕͔Θ͍͔ͬͨͷͰw) 20171݄
Kotlinͱͷग़ձ͍ ্ژ͠৽ଔͰαʔόʔαΠυΤϯδχΞʹͳΔ KotlinҾ͖ଓ͖झຯͰॻ͘ 20174݄
Kotlinͱͷग़ձ͍ GoogleIO Kotlin͕AndroidΞϓϦ։ൃͷओཁݴޠͱͳΔ 20175݄
Δ͔͠ͳ͍ ͜ͷϏοάΣʔϒʹ
ͪΌΜͱKotlinΛॻ͜͏ (ͱ͍͏͔༡΅͏)
KotlinͰ༡Ϳ(part1) μʔπϘʔυͱ࿈ܞͨ͠ DartsXͱ͍͏ΞϓϦΛͭͬͯ͘༡Ϳ 20176݄~10݄
None
None
KotlinͰ༡Ϳ(part1) ͪΐͪ͜ΐ͜Kotlin͞ΘΔ 201710݄~20184݄
KotlinͰ༡Ϳ(part2) GoogleIO ͜ͷ࣌ظʹͳΔͱ Android or KotlinͷษڧձΜʹͳΔ (ؾ͕͢Δ) 20185݄
ͬͱਂ͘۷ΓԼ͛Δ ༡ͼ͔ͨΛ͠Α͏
Kotlinͱ༡Ϳ(part2) ֤ࣾͷΤϯδχΞϒϩάΛ εϚχϡʔͬΆ͘ݟΒΕΔ EngineerBlogsΛ࡞(ਐߦத) 20186݄~ݱࡏ
DataBindingͱPicasso
͜Μͳ͜ͱ͋Γ·ͤΜ͔ DataBindingΛར༻͍ͯ͠ΔAndroidΞϓϦͰɺ PicassoGlideͰImageViewʹ ը૾Λද͍ࣔͤͨ͞
͜Μͳ͜ͱ͋Γ·ͤΜ͔ DataBindingΛར༻͍ͯ͠ΔAndroidΞϓϦͰɺ PicassoGlideͰImageViewʹ ը૾Λද͍ࣔͤͨ͞ BindingAdapter
XMLͷ αϯϓϧ
XMLͷ αϯϓϧ
Custom Binding KotlinͬΆ͘ImageViewͷ֦ுؔΛͬͯΈͨ
https://qiita.com/yoppie_x/items/ afcf582c083918c2c719
KotlinͱGson
KotlinͱGson૬ੑ͕ѱ͍ non-nullͳϓϩύςΟʹnull͕ ೖͬͯ͠·͏Մೳੑ
KotlinͱGson૬ੑ͕ѱ͍ Kotlinͷੑ্࣭id, name, imgnon-null img͕ͳ͍jsonΛparse͢Δ ྫ֎͕throw͞Εͣɺimgʹnull͕ೖΔ
MoshiΛ͏ Kotlin extension KotlinͷclassͷύʔεΛαϙʔτ nullͷ߹parse࣌ʹྫ֎͕throw͞ΕΔ build.gradle
Retrofit2ͱMoshiͷ࣮ྫ
https://qiita.com/yoppie_x/items/ bbc0ca7a4c8a4b29e141
KotlinͱRxBinding2
RxBinding2 • Jake Wharton࡞ • ViewͰͷΠϕϯτʹର༷ͯ͠ʑͳ݅ͳͲΛ ༩͠subscribe͢Δ͜ͱͰViewͰͷΞΫγϣ ϯΛ੍ޚ • Kotlin༷ʹ֦ு͞Ε͍ͯΔϥΠϒϥϦΛར༻
RxBinding2 • rxbinding-kotlin • rxbinding-recyclerview-v7-kotlin • rxbinding-appcompat-v7-kotlin • rxbinding-support-v4-kotlin •
rxbinding-design-kotlin • rxbinding-leanback-v17-kotlin
ಋೖ build.gradle
ಋೖ build.gradle -kotlin͕ඞཁ
rxbinding-kotlin OnClickListenerΑΓγϯϓϧ
rxbinding-recyclerview-v7-kotlin RecyclerViewͰεΫϩʔϧ͕Ұ൪Լ·Ͱ͍ͬͨΒ ϩʔυ͢Δ࣮
rxbinding-support-v4-kotlin Support-v4 LibraryͰಋೖͰ͖ΔViewʹର͢Δ ΞΫγϣϯΛ੍ޚ (ྫ)SwipeRefreshLayout
KotlinͰRxBinding2Λ ͬͯΈͨײ • ใ͕গͳ͍ͷ͕͖͍ͭ • ϝιουνΣʔϯͰ͔͚Δͷ͕͍͍ • Viewͷϓϩηεͷάϧʔϐϯά • Kotlinͷ֦ுؔ,
ଞͷRxܥͷϥΠϒϥϦͱ Έ߹ΘͤΔ͜ͱͰγϯϓϧʹͳΓͦ͏
https://qiita.com/yoppie_x/items/ c04974a346f7f5d4b413
݁
KotlinΧϫΠΠ
ΧϫΠΠਖ਼ٛ
Kotlinਖ਼ٛ
͜Ε͔Β KotlinͰ༡Ϳʂ