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

Exploring Jetpack Compose : Droidcon Vienna

Exploring Jetpack Compose : Droidcon Vienna

The Android UI toolkit API has remained the same for nearly a decade now and while new libraries like recyclerView, constraintLayout, motionLayout were launched, the toolkit was never changed fundamentally.

Jetpack Compose presents a radical shift in the way developers think about and write UI code on Android.

What is Jetpack Compose?

Jetpack Compose is an unbundled toolkit designed to simplify UI development. It combines a reactive programming model with the conciseness and ease of use of the Kotlin programming language.

With compose, UI components are fully declarative and allow developers to create layouts by simply describing what the UI should look like in their code.

Join me as we dive into setting up and building apps with JetPack compose, which will soon become the most intuitive way of writing UI code on Android.

Kaustav Jaiswal

September 19, 2019
Tweet

More Decks by Kaustav Jaiswal

Other Decks in Technology

Transcript

  1. Exploring Jetpack Compose Sneak peek into the future of Android

    UI @kaustavjaiswal Kaustav Jaiswal Senior Android Developer Amadeus
  2. 2008 Android 1.0 is released 2013 Android Studio 2014 ART,

    Recycler View 2017 Constraint Layout, Kotlin, Arch Components 2019 Jetpack Compose @kaustavjaiswal A brief look at Android history Credits: Declarative UI Patterns (Google I/O'19)
  3. What is compose? Built from the ground up by the

    Android Team @kaustavjaiswal Inspired by React, Litho, Vue.js & Flutter
  4. What is compose? Jetpack Compose presents a radical shi in

    the way developers think about and write UI code on Android @kaustavjaiswal
  5. Get Compose Up and Running Fork the AndroidX components from

    the AOSP Run a special version of Android Studio with compose compiler plugins enabled. All steps mentioned here http://bit.ly/setupcompose Linux and Mac Windows http://bit.ly/composewin10 @kaustavjaiswal
  6. @kaustavjaiswal Generated Code for a composable function IR (Intermediate Representation)

    Transform Perform Optimizations Compiler Back-end Experimental Compose Work
  7. Gap Buffers @kaustavjaiswal Compose uses a slightly different implementation of

    Gap Buffers called Slot Tables Core principles are same Tradeoffs are the same
  8. Gap Buffers @kaustavjaiswal For a gap buffer all operations ->

    Insert, update, delete are constant time Except for moving the gap Move the gap when the structure of the tree changes Making a bet that the structure of the UI doesn’t change very often, but values do
  9. Positional Memoization @kaustavjaiswal [ a , b , c ]

    EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY
  10. What’s next? UI Landscape is quickly evolving One-way data flow

    model What about my existing views? Layout editor? Preview Tool? Potential to use the Compose runtime and compiler plugin for other libraries? Multithreaded layout! @kaustavjaiswal
  11. References and Credits Big shout out to @intelligibabble http://intelligiblebabble.com/comp ose-from-first-principles/

    Compose slack channel Chain React Conf Talk http://bit.ly/reactmeetcompose https://www.geeksforgeeks.org/ga p-buffer-data-structure/ @kaustavjaiswal Declarative UI Patterns talk http://bit.ly/declarativeGoogleio19 Unsplash – For all slide title images https://unsplash.com/ Kotlin/Everywhere Talk by @ragunathjawahar https://speakerdeck.com/ragunathj awahar/jetpack-compose-next-gen- kotlin-ui-toolkit-for-android