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

Sliceのアレコレ

 Sliceのアレコレ

B8f695167d115eef9f32399b1c9261df?s=128

Yuki Mima

May 29, 2018
Tweet

Transcript

  1. 4MJDFTͷΞϨίϨ (PPHMF*0ࢀՃใࠂձ !BNZV@TBO

  2. "CPVUNF w .JNB:VLJ w !BNZV@TBO w /&95$633&/$: */$ w "OESPJE&OHJOFFS

  3. ͋Γ͕ͱ͏Ŋฐࣾ

  4. ͋Γ͕ͱ͏Ŋฐࣾ

  5. None
  6. "HFOEB w (PPHMF*0ͷײ૝ͱ஌ݟ w 4MJDFTͷ࿩ w ·ͱΊ

  7. (PPHMF*0ͷ஌ݟ w ։࠵ͷલલ೔ೖΓ͕ྑͦ͞͏ w ࣌ࠩϘέ·͡ਏ͍ w ૣΊͷ#BEHF1JDLVQͰΑΓྑ͍੮Ͱ,FZOPUFΛݟΕΔ w ௚௨ͷγϟτϧόε͕ग़Δϗςϧ͕Α͍ w

    IUUQTXXXDPVOUSZJOOTDPN w #BEHF1JDLVQͷ࣌ؒ͸ޕલ࣌෼͘Β͍͕ྑͦ͞͏ w ன൧͕ޱʹ߹Θͳ͍ w 6CFS࠷ߴ
  8. (PPHMF*0ͷײ૝ w ·ͨདྷ೥΋ߦ͖͍ͨ

  9. 4MJDFTͷ࿩

  10. ͜͜ͷ෦෼

  11. None
  12. ࡞ͬͯΈͨ

  13. None
  14. PO#JOE4MJDF 4MJDF1SPWJEFS GFUDI"1* 4FSWJDF TUBSU4FSWJDF DPOUFOU3FTPMWFSOPUJGZ$IBOHF VSJ

  15. class CryptoSliceProvider : SliceProvider() { private val path = "/crypto"

    override fun onCreateSliceProvider(): Boolean = true override fun onBindSlice(sliceUri: Uri): Slice? = when (sliceUri.path) { path -> { context.startService(Intent(context, CryptoService::class.java)) createCryptoSlice(sliceUri) } else -> null } private fun createCryptoSlice(sliceUri: Uri): Slice? = ListBuilder(context, sliceUri, ListBuilder.INFINITY) .addGridRow { it.apply { addCell { it.apply { addImage(IconCompat.createWithResource(context, R.drawable.ic_bitcoin), SMALL_IMAGE) addTitleText("Bitcoin") addText(CryptoService.bitcoin, true) } } ... } } .build() }
  16. class CryptoSliceProvider : SliceProvider() { private val path = "/crypto"

    override fun onCreateSliceProvider(): Boolean = true override fun onBindSlice(sliceUri: Uri): Slice? = when (sliceUri.path) { path -> { context.startService(Intent(context, CryptoService::class.java)) createCryptoSlice(sliceUri) } else -> null } private fun createCryptoSlice(sliceUri: Uri): Slice? = ListBuilder(context, sliceUri, ListBuilder.INFINITY) .addGridRow { it.apply { addCell { it.apply { addImage(IconCompat.createWithResource(context, R.drawable.ic_bitcoin), SMALL_IMAGE) addTitleText("Bitcoin") addText(CryptoService.bitcoin, true) } } ... } } .build() }
  17. class CryptoSliceProvider : SliceProvider() { private val path = "/crypto"

    override fun onCreateSliceProvider(): Boolean = true override fun onBindSlice(sliceUri: Uri): Slice? = when (sliceUri.path) { path -> { context.startService(Intent(context, CryptoService::class.java)) createCryptoSlice(sliceUri) } else -> null } private fun createCryptoSlice(sliceUri: Uri): Slice? = ListBuilder(context, sliceUri, ListBuilder.INFINITY) .addGridRow { it.apply { addCell { it.apply { addImage(IconCompat.createWithResource(context, R.drawable.ic_bitcoin), SMALL_IMAGE) addTitleText("Bitcoin") addText(CryptoService.bitcoin, true) } } ... } } .build() }
  18. class CryptoSliceProvider : SliceProvider() { private val path = "/crypto"

    override fun onCreateSliceProvider(): Boolean = true override fun onBindSlice(sliceUri: Uri): Slice? = when (sliceUri.path) { path -> { context.startService(Intent(context, CryptoService::class.java)) createCryptoSlice(sliceUri) } else -> null } private fun createCryptoSlice(sliceUri: Uri): Slice? = ListBuilder(context, sliceUri, ListBuilder.INFINITY) .addGridRow { it.apply { addCell { it.apply { addImage(…) addTitleText("Bitcoin") addText(CryptoService.bitcoin, true) } } ... } } .build() }
  19. class CryptoSliceProvider : SliceProvider() { private val path = "/crypto"

    override fun onCreateSliceProvider(): Boolean = true override fun onBindSlice(sliceUri: Uri): Slice? = when (sliceUri.path) { path -> { context.startService(Intent(context, CryptoService::class.java)) createCryptoSlice(sliceUri) } else -> null } private fun createCryptoSlice(sliceUri: Uri): Slice? = ListBuilder(context, sliceUri, ListBuilder.INFINITY) .addGridRow { it.apply { addCell { it.apply { addImage(…) addTitleText("Bitcoin") addText(CryptoService.bitcoin, true) } } ... } } .build() }
  20. class CryptoService : Service() { companion object { var bitcoin:

    String? = null ... } override fun onBind(p0: Intent?): IBinder? = null override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int = START_NOT_STICKY.also { _ -> apiClient.getCryptoList() .doOnFinish { stopSelf() } .subscribe({ bitcoin = "ˇ${it.toNumberformat()}" ... applicationContext.contentResolver.notifyChange(uri, null) }, { }) } }
  21. class CryptoService : Service() { companion object { var bitcoin:

    String? = null ... } override fun onBind(p0: Intent?): IBinder? = null override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int = START_NOT_STICKY.also { _ -> apiClient.getCryptoList() .doOnFinish { stopSelf() } .subscribe({ bitcoin = "ˇ${it.toNumberformat()}" applicationContext.contentResolver.notifyChange(uri, null) }, { }) } }
  22. class CryptoService : Service() { companion object { var bitcoin:

    String? = null ... } override fun onBind(p0: Intent?): IBinder? = null override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int = START_NOT_STICKY.also { _ -> apiClient.getCryptoList() .doFinally { stopSelf() } .subscribe({ bitcoin = "ˇ${it.toNumberformat()}" ... applicationContext.contentResolver.notifyChange(uri, null) }, { }) } }
  23. None
  24. ͱͬͯ΋؆୯ͩͶ

  25. None
  26. ·ͱΊ

  27. w IUUQTUFDICMPHQJDBQQJODKQHPPHMFJ P&"&&#& #&"&#&# "&$&"&'TMJD FT&"&&"#EFCC

  28. ·ͨདྷ೥΋ߦ͔ͤͯ͘ ͍ͩ͞