layout xml? try Anko!

5f533179da1c82722252cbcb93e7356f?s=47 Moyuru Aizawa
December 09, 2016

layout xml? try Anko!

Shibuya.apk
Ankoについての発表

TwitterID変えました。@lvla0805 -> @MoyuruAizawa

5f533179da1c82722252cbcb93e7356f?s=128

Moyuru Aizawa

December 09, 2016
Tweet

Transcript

  1. MBZPVUYNM !MWMB

  2. MWMB MWMB Ѫᖒ๖ .PZVSV"J[BXB   -FBEFOHJOFFSPGQBJST%JWFVSFLB *OD

  3.  QBJST  $PVQMFT  NBUDIHSPVQ *"$  IJSJOH

  4. ‣ *UJTOPUUZQFTBGF ‣ *UJTOPUOVMMTBGF ‣ *UGPSDFTZPVUPXSJUFBMNPTUUIFTBNFDPEFGPSFWFSZMBZPVU ZPVNBLF ‣ 9.-JTQBSTFEPOEFWJDFXBTUJOH$16UJNFBOECBUUFSZ ‣

    .PTUPGBMM JUBMMPXTOPDPEFSFVTF 6*XSJUUFOVTJOH9.-
  5. JU`TIBSEMZEPOFCFDBVTFJU`TTPNFXIBUVHMZBOEIBSEUPNBJOUBJO 8IJMFZPVDBODSFBUF6*QSPHSBNNBUJDBMMZʜ val act = this val layout = LinearLayout(act)

    layout.orientation = LinearLayout.VERTICAL val name = EditText(act) val button = Button(act) button.text = "Say Hello" button.setOnClickListener { Toast.makeText(act, "Hello, ${name.text}!", Toast.LENGTH_SHORT)
 .show() } layout.addView(name) layout.addView(button)
  6. "OLPNBLFTUIFTBNFMPHJDFBTZUPSFBE FBTZUPXSJUF verticalLayout { val name = editText() button("Say Hello")

    { onClick { toast("Hello, ${name.text}!") } } }
  7. )PXJUXPSLT

  8. "OLPDPOTJTUTPGTPNF,PUMJOFYUFOTJPOGVODUJPOBOEQSPQFSUJFT 5IFSFJTOP fun Activity.verticalLayout(init: _LinearLayout.()->Unit): LinearLayout fun ViewManager.button(text: CharSequence?, init:

    Button.()->Unit): Button
  9. &YUFOTJPOGVODUJPOPG"DUJWJUZ 5IFSFJTOP fun Activity.verticalLayout(init: _LinearLayout.()->Unit): LinearLayout fun ViewManager.button(text: CharSequence?, init:

    Button.()->Unit): Button
  10. &YUFOTJPOGVODUJPOPG@-JOFBS-BZPVU TVCDMBTTPG-JOFBS-BZPVU 5IFSFJTOP fun Activity.verticalLayout(init: _LinearLayout.()->Unit): LinearLayout fun ViewManager.button(text: CharSequence?,

    init: Button.()->Unit): Button
  11. &YUFOTJPOGVODUJPOPG7JFX.BOBHFS JOUFSGBDFUIBU7JFX(SPVQJNQMFNFOUT 5IFSFJTOP fun Activity.verticalLayout(init: _LinearLayout.()->Unit): LinearLayout fun ViewManager.button(text: CharSequence?,

    init: Button.()->Unit): Button
  12. &YUFOTJPOGVODUJPOPG#VUUPO 5IFSFJTOP fun Activity.verticalLayout(init: _LinearLayout.()->Unit): LinearLayout fun ViewManager.button(text: CharSequence?, init:

    Button.()->Unit): Button
  13. 5IFSFJTOP fun Activity.verticalLayout(init: _LinearLayout.()->Unit): LinearLayout fun ViewManager.button(text: CharSequence?, init: Button.()->Unit):

    Button verticalLayout { val name = editText() button("Say Hello") { onClick { toast("Hello, ${name.text}!") } } }
  14. 5IFUIJTLFZXPSEDPSSFTQPOETUP@-JOFBS-BZPVU 5IFSFJTOP fun Activity.verticalLayout(init: _LinearLayout.()->Unit): LinearLayout fun ViewManager.button(text: CharSequence?, init:

    Button.()->Unit): Button verticalLayout { val name = editText() button("Say Hello") { onClick { toast("Hello, ${name.text}!") } } }
  15. 5IFUIJTLFZXPSEDPSSFTQPOETUP#VUUPO 5IFSFJTOP fun Activity.verticalLayout(init: _LinearLayout.()->Unit): LinearLayout fun ViewManager.button(text: CharSequence?, init:

    Button.()->Unit): Button verticalLayout { val name = editText() button("Say Hello") { onClick { toast("Hello, ${name.text}!") } } }
  16. *TJUFYUFOTJCMF

  17. JGZPVXBOUUPVTFB.BQ7JFXJOUIF%4-  XSJUFUIJTJOBOZ,PUMJOpMF *TJUFYUFOTJCMF public inline fun ViewManager.mapView(theme: Int =

    0, init: MapView.()->Unit) = ankoView({ MapView(it) }, theme, init)
  18. 5SZ"OLP
 IUUQTHJUIVCDPN,PUMJOBOLP

  19. 5IBOLZPV