Jetpack Compose: The new Way of Building Android UI
I gave a talk on Jetpack Compose, which is a Modern toolkit for building native Android UI. Jetpack Compose simplifies and accelerates UI development on Android with less code, powerful tools, and intuitive Kotlin APIs.
Challenges findViewById() – XML data binding and view binding APIs are showing signs of ageing RecyclerView View Class keeps getting bigger and bigger ...
Jetpack Compose Modern toolkit for building native Android UI. Jetpack Compose simplifies and accelerates UI development on Android with less code, powerful tools, and intuitive Kotlin APIs.
Inspired by 1. React 2. Litho 3. Vue.js 4. Flutter ... but it’s written completely in Kotlin and is fully compatible with the existing Android view system.
Declarative This pattern is an emerging trend that allows the developers to design the user interface based on the data received. This is the most common paradigm; it involves having a separate prototype/model of the application’s UI. Imperative
Declarative This design paradigm makes use of one programming language to create an entire application. A good example is XML layouts in Android. We design the widgets and components which are then rendered for the user to see and interact with. Imperative
Modifiers ● Are used to modify the composable UI elements for example adding margin, padding or defining the width and height. ● Available modifiers are:background(), clickable, scrollable, draggable, swipeable, width(), height(), size(), padding() . . . . .
LAzy COlumn A LazyColumn is a vertically scrolling list that only composes and lays out the currently visible items. It’s similar to a Recyclerview in the classic Android View system.