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

Compose your TRILL

Compose your TRILL

Slides for the talk at Brighton Kotlin on 24/06/2021
"Compose your TRIL"

Luca Nicoletti

June 24, 2021
Tweet

More Decks by Luca Nicoletti

Other Decks in Programming

Transcript

  1. /32 luca_nicolett • What is Jetpack Compose • Setup •

    Target (in our app) • Code comparison • Conclusions COMPOSE YOUR TRILL 2
  2. /32 luca_nicolett • Modern UI toolkit • Based on Kotlin

    (more on this) • Paradigm switch (more on this) • Decoupled from the OS JETPACK COMPOSE 3
  3. /32 luca_nicolett • 100% kotlin • Not only a UI

    toolkit • Compose UI + Compose compiler • @Composable == suspend? KOTLIN 4
  4. /32 luca_nicolett • Functional • Pure & side effect -

    free • Trailing lambda syntax highly used KOTLIN 5
  5. /32 luca_nicolett • Declarative API • Declarative vs Imperative •

    Widget tree with internal state (setText, setVisibility, addChild, setImageBitmap) • Illegal states (2 updates con fl ict in an unexpected way) THINKING DECLARATIVE Imperative: 
 - put block 1 
 - put block 2 above 
 - put block 3 above Declarative: 
 - A tower with: 
 - block 1, block 2, block 3 6
  6. /32 luca_nicolett • Describe your UI right now • For

    any value of now • Code independent of previous state THINKING DECLARATIVE 7
  7. /32 luca_nicolett THINKING DECLARATIVE SCREEN LIST ITEM ITEM ITEM Events

    Data SCREEN LIST ITEM ITEM ITEM Events Data 8
  8. /32 luca_nicolett • Worthiness • Speed of development • Learning

    curve • Have it “approved” CONCLUSIONS 30