Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Play with Kotlin

054312bb8749ab2405c3c5364bc1be1e?s=47 yoppie
March 25, 2019

Play with Kotlin

Kotlinで遊ぶ

054312bb8749ab2405c3c5364bc1be1e?s=128

yoppie

March 25, 2019
Tweet

More Decks by yoppie

Other Decks in Technology

Transcript

  1. KotlinͰ༡Ϳ

  2. Facebook hi.kowaii.de / Twitter @yoppie_x Github yoshiya12X / Qiita yoppie_x

    ϒϩά https://yoppiex.hatenablog.com/ yoppie
  3. Kotlinͱͷग़ձ͍ ιϑτ΢ΣΞ޻ֶͷݚڀ
 AndroidΞϓϦͷιʔείʔυΛର৅ͱ͍ͯͨ͠
 ࣗ෼Ͱ΋ͪΐͪ͜ΐ͜AndroidΞϓϦΛ࡞ͬͯͨ ֶ෦ େֶӃ

  4. Kotlinͱͷग़ձ͍ KotlinΛॻ͖࢝ΊΔ
 (໊લ͕͔Θ͍͔ͬͨͷͰw) 2017೥1݄

  5. Kotlinͱͷग़ձ͍ ্ژ͠৽ଔͰαʔόʔαΠυΤϯδχΞʹͳΔ
 Kotlin͸Ҿ͖ଓ͖झຯͰॻ͘ 2017೥4݄

  6. Kotlinͱͷग़ձ͍ GoogleIO
 Kotlin͕AndroidΞϓϦ։ൃͷओཁݴޠͱͳΔ 2017೥5݄

  7. ৐Δ͔͠ͳ͍ ͜ͷϏοά΢Σʔϒʹ

  8. ͪΌΜͱKotlinΛॻ͜͏
 (ͱ͍͏͔༡΅͏)

  9. KotlinͰ༡Ϳ(part1) μʔπϘʔυͱ࿈ܞͨ͠
 DartsXͱ͍͏ΞϓϦΛͭͬͯ͘༡Ϳ 2017೥6݄~10݄

  10. None
  11. None
  12. KotlinͰ༡Ϳ(part1) ͪΐͪ͜ΐ͜Kotlin͞ΘΔ 2017೥10݄~2018೥4݄

  13. KotlinͰ༡Ϳ(part2) GoogleIO
 
 ͜ͷ࣌ظʹͳΔͱ
 Android or Kotlinͷษڧձ͸੝ΜʹͳΔ
 (ؾ͕͢Δ) 2018೥5݄

  14. ΋ͬͱਂ͘۷ΓԼ͛Δ
 ༡ͼ͔ͨΛ͠Α͏

  15. Kotlinͱ༡Ϳ(part2) ֤ࣾͷΤϯδχΞϒϩάΛ
 εϚχϡʔͬΆ͘ݟΒΕΔ
 EngineerBlogsΛ࡞੒(ਐߦத) 2018೥6݄~ݱࡏ

  16. DataBindingͱPicasso

  17. ͜Μͳ͜ͱ͋Γ·ͤΜ͔ DataBindingΛར༻͍ͯ͠ΔAndroidΞϓϦͰɺ Picasso΍GlideͰImageViewʹ
 ը૾Λද͍ࣔͤͨ͞

  18. ͜Μͳ͜ͱ͋Γ·ͤΜ͔ DataBindingΛར༻͍ͯ͠ΔAndroidΞϓϦͰɺ Picasso΍GlideͰImageViewʹ
 ը૾Λද͍ࣔͤͨ͞ BindingAdapter

  19. XMLͷ αϯϓϧ

  20. XMLͷ αϯϓϧ

  21. Custom Binding KotlinͬΆ͘ImageViewͷ֦ுؔ਺Λ࢖ͬͯΈͨ

  22. https://qiita.com/yoppie_x/items/ afcf582c083918c2c719

  23. KotlinͱGson

  24. KotlinͱGson͸૬ੑ͕ѱ͍ non-nullͳϓϩύςΟʹnull͕
 ೖͬͯ͠·͏Մೳੑ

  25. KotlinͱGson͸૬ੑ͕ѱ͍ Kotlinͷੑ্࣭id, name, img͸non-null img͕ͳ͍jsonΛparse͢Δ ྫ֎͕throw͞Εͣɺimgʹnull͕ೖΔ

  26. MoshiΛ࢖͏ Kotlin extension
 Kotlinͷclass΁ͷύʔεΛαϙʔτ
 nullͷ৔߹parse࣌ʹྫ֎͕throw͞ΕΔ build.gradle

  27. Retrofit2ͱMoshiͷ࣮૷ྫ

  28. https://qiita.com/yoppie_x/items/ bbc0ca7a4c8a4b29e141

  29. KotlinͱRxBinding2

  30. RxBinding2 • Jake Wharton࡞ • ViewͰͷΠϕϯτʹର༷ͯ͠ʑͳ৚݅ͳͲΛ ෇༩͠subscribe͢Δ͜ͱͰViewͰͷΞΫγϣ ϯΛ੍ޚ • Kotlin࢓༷ʹ֦ு͞Ε͍ͯΔϥΠϒϥϦΛར༻

  31. RxBinding2 • rxbinding-kotlin • rxbinding-recyclerview-v7-kotlin • rxbinding-appcompat-v7-kotlin • rxbinding-support-v4-kotlin •

    rxbinding-design-kotlin • rxbinding-leanback-v17-kotlin
  32. ಋೖ build.gradle

  33. ಋೖ build.gradle -kotlin͕ඞཁ

  34. rxbinding-kotlin OnClickListenerΑΓγϯϓϧ

  35. rxbinding-recyclerview-v7-kotlin RecyclerViewͰεΫϩʔϧ͕Ұ൪Լ·Ͱ͍ͬͨΒ ϩʔυ͢Δ࣮૷

  36. rxbinding-support-v4-kotlin Support-v4 LibraryͰಋೖͰ͖ΔViewʹର͢Δ ΞΫγϣϯΛ੍ޚ (ྫ)SwipeRefreshLayout

  37. KotlinͰRxBinding2Λ
 ࢖ͬͯΈͨײ૝ • ৘ใ͕গͳ͍ͷ͕͖͍ͭ • ϝιουνΣʔϯͰ͔͚Δͷ͕͍͍ • Viewͷϓϩηεͷάϧʔϐϯά • Kotlinͷ֦ுؔ਺,

    ଞͷRxܥͷϥΠϒϥϦͱ
 ૊Έ߹ΘͤΔ͜ͱͰγϯϓϧʹͳΓͦ͏
  38. https://qiita.com/yoppie_x/items/ c04974a346f7f5d4b413

  39. ݁࿦

  40. Kotlin͸ΧϫΠΠ

  41. ΧϫΠΠ͸ਖ਼ٛ

  42. Kotlin͸ਖ਼ٛ

  43. ͜Ε͔Β΋
 KotlinͰ༡Ϳʂ