Jetpack Compose: The new Way of Building Android UI
Jetpack Compose is a modern toolkit for building native Android UI. It simplifies and accelerates UI development on Android with less code, powerful tools, and intuitive Kotlin APIs.
This work is licensed under the Apache 2 license. Android Development with Kotlin v1.0 1 Jetpack compose: The new way of building Android UI 1 1 Umar Saidu Auna Software Engineer, gidimo tech community Organizer umarauna February 19, 2022
data binding and view binding //initialize it private lateinit var binding:BottomSheetBuyUnitBinding //bind it to Fragment binding = BottomSheetBuyUnitBinding.inflate(inflater, container,false) return binding.root //make use of it binding.backImageView.setOnClickListener { dismiss() }
View Class keeps getting bigger and bigger - View Class has over 31110 lines of code - All the Views(TextView, Button, ImageView, RadioButton etc) inherits from the View Class - Becomes difficult to maintain
Modern toolkit for building native Android UI. It simplifies and accelerates UI development on Android with less code, powerful tools, and intuitive Kotlin APIs. Jetpack Compose
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. Inspired by
This pattern is an emerging trend that allows the developers to design the user interface based on the data received. Declarative Imperative This is the most common paradigm; it involves having a separate prototype/model of the application’s UI.
This design paradigm makes use of one programming language to create an entire application. Declarative Imperative 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.
1. Are used to modify the composable UI elements for example adding margin, padding or defining the width and height. 2. Available modifiers are:background(), clickable, scrollable, draggable, swipeable, width(), height(), size(), padding() . . . . . Modifiers
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. LAzy COlumn
This work is licensed under the Apache 2 license. Android Development with Kotlin v1.0 6 0 Questions? Thank you! 6 0 6 0 Umar Saidu Auna Software Engineer, gidimo tech community Organizer umarauna