Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

LINE Creators StudioでのKotlin利用について

412 views

Published on

2018年11月15日に京都で行われたLINE Developer Meetup #46 in Kyotoでの登壇資料です

Published in: Technology
  • Be the first to comment

LINE Creators StudioでのKotlin利用について

  1. 1. LINE Creators Studio ❤ Kotlin , 8 0 4 5 1 6 4 2 6 LINE Fukuoka 1 8 #
  2. 2. LINE Creators Studio ❤ Kotlin LINE Creators Studio? L I E : N / . /
  3. 3. LINE Creators Studio ❤ Kotlin LINE Creators Studio H- A D A A J H H E E A E 2 2 A GA , AA 3 2 A A Android
  4. 4. LINE Creators Studio ❤ Kotlin History . 1 0 678 4 . V[U . ]e 2 e0 e0 e 0 e3 . 9 4 . 5 I . 1I . . 4 . 1
  5. 5. LINE Creators Studio ❤ Kotlin History . 1 0 678 4 . V[U . ]e 2 e0 e0 e 0 e3 . 9 4 . 5 I . 1I . . 4 . 1
  6. 6. LINE Creators Studio ❤ Kotlin : : a .885 6 8 6 2 - 1/ 2 0 6 ./ 7 .821
  7. 7. LINE Creators Studio ❤ Kotlin History . 1 0 678 4 . V[U . ]e 2 e0 e0 e 0 e3 . 9 4 . 5 I . 1I . . 4 . 1
  8. 8. LINE Creators Studio ❤ Kotlin History . 1 0 678 4 . V[U . ]e 2 e0 e0 e 0 e3 . 9 4 . 5 I . 1I . . 4 . 1
  9. 9. LINE Creators Studio ❤ Kotlin …
  10. 10. LINE Creators Studio ❤ Kotlin Ver.1.0
  11. 11. LINE Creators Studio ❤ Kotlin Ver.1.3
  12. 12. LINE Creators Studio ❤ Kotlin Ver.1.4
  13. 13. LINE Creators Studio ❤ Kotlin Ver.1.5
  14. 14. LINE Creators Studio ❤ Kotlin 4 2. 1 5 1 3 1 2 3 4 Ver.2.1 (Android only)
  15. 15. LINE Creators Studio ❤ Kotlin
  16. 16. LINE Creators Studio ❤ Kotlin Roadmap
  17. 17. LINE Creators Studio ❤ Kotlin / : / . GrabCut
  18. 18. LINE Creators Studio ❤ Kotlin GrabCut 3 1 G 3 1 . 2 2 . M GrabCut
  19. 19. LINE Creators Studio ❤ Kotlin GrabCut z e rp a p GM8 p rp mu t M8 s g p:rp M hw M M8 c G M8 GrabCut .330 2 14 6 1 2 1 . /
  20. 20. LINE Creators Studio ❤ Kotlin GrabCut a: : 8 M 8h Mg c g pe c g z t c w c G c c r s r u m GrabCut /441 666 3 25 2 3 2 / . 0
  21. 21. LINE Creators Studio ❤ Kotlin GrabCut g t M m M : c m w r : a m c : c a he : a z : spM M : g M u G z : GrabCut 0552 777 4 36 8 3.4. 3 0 / 1
  22. 22. LINE Creators Studio ❤ Kotlin % C 0 12 . 0 G % 0 C
  23. 23. LINE Creators Studio ❤ Kotlin 03 2 7 .( 0 1 M ) )
  24. 24. LINE Creators Studio ❤ Kotlin 2 2 CG 1 1 . 1
  25. 25. LINE Creators Studio ❤ Kotlin Why Kotlin? - DEC I J - Kotlin
  26. 26. LINE Creators Studio ❤ Kotlin Why Kotlin? val color = Color.CYAN val alpha = (color shr 24) and 0xff val red = (color shr 16) and 0xff val green = (color shr 8) and 0xff val blue = (color ) and 0xff
  27. 27. LINE Creators Studio ❤ Kotlin Why Kotlin? inline val @receiver:ColorInt Int.alpha get() = (this shr 24) and 0xff inline val @receiver:ColorInt Int.red get() = (this shr 16) and 0xff inline val @receiver:ColorInt Int.green get() = (this shr 8) and 0xff inline val @receiver:ColorInt Int.blue get() = (this ) and 0xff
  28. 28. LINE Creators Studio ❤ Kotlin Why Kotlin? val a = color.alpha val r = color.red val g = color.green val b = color.blue
  29. 29. LINE Creators Studio ❤ Kotlin Why Kotlin? inline operator fun @receiver:ColorInt Int.component1() = this.alpha inline operator fun @receiver:ColorInt Int.component2() = this.red inline operator fun @receiver:ColorInt Int.component3() = this.green inline operator fun @receiver:ColorInt Int.component4() = this.blue
  30. 30. LINE Creators Studio ❤ Kotlin Why Kotlin? val (alpha, red, green, blue) = color
  31. 31. LINE Creators Studio ❤ Kotlin Why Kotlin? https://developer.android.com/kotlin/ktx / J / Ii P / X / r P / ae c t K / IplJ / I a ec k ed ed I r P / P / o I I P / I / n P J KAT Android KTX
  32. 32. LINE Creators Studio ❤ Kotlin Creators Studio Extensions for OpenCV val bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888) val mat = Mat() Utils.bitmapToMat(bitmap, mat) val newBitmap = Bitmap.createBitmap(mat.width(), mat.height(), Bitmap.Config.ARGB_8888) Utils.matToBitmap(mat, newBitmap)
  33. 33. LINE Creators Studio ❤ Kotlin Creators Studio Extensions for OpenCVinterface OpenCVUtils { fun Bitmap.toMat(): Mat { val mat = Mat() Utils.bitmapToMat(this, mat) return mat } fun Mat.toBitmap(): Bitmap { val bitmap = Bitmap.createBitmap(width(), height(), Bitmap.Config.ARGB_8888) Utils.matToBitmap(this, bitmap) return bitmap } }
  34. 34. LINE Creators Studio ❤ Kotlin Creators Studio Extensions for OpenCV val bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888) val mat = bitmap.toMat() val newBitmap = mat.toBitmap()
  35. 35. I ❤ Kotlin.
  36. 36. LINE Creators Studio ❤ Kotlin Kotlin ) / ( Kotlin 1.3 Released!
  37. 37. LINE Creators Studio ❤ Kotlin Cross platform framework…? Flutter, React Native, Xamarin etc.
  38. 38. LINE Creators Studio ❤ Kotlin Multiplatform Kotlin Kotlin(.kt) Android iOS Kotlin/Native Kotlin/JVM Java bytecode Native code
  39. 39. LINE Creators Studio ❤ Kotlin Multiplatform Kotlin Kotlin(.kt) Android iOS Android library (.jar) iOS library (.framework) Kotlin/Native Import Java bytecode Native code Kotlin(.kt) Swift(.swift)Kotlin/Native Import
  40. 40. LINE Creators Studio ❤ Kotlin Multiplatform Kotlin Data Model Repositories Utils View Interfaces Android iOS View View
  41. 41. LINE Creators Studio ❤ Kotlin Multiplatform Kotlin /
  42. 42. Thank you.

×