Book License
What You Need
Book Source Code & Forums
About the Authors
About the Editors
Acknowledgments
Content Development
Introduction
How to Read This Book
Chapter 1: Developing UI in Android
Unwrapping the Android UI Toolkit
Introduction to Jetpack Compose
Jetpack Compose’s Tech Stack
Key Points
Where to Go From Here?
Chapter 2: Learning Jetpack Compose Fundamentals
Composable Functions
Basic Composable Functions
Text
Previewing Changes
TextField
Buttons
Progress Bars
AlertDialog
Key Points
Where to Go From Here?
Chapter 3: Building Layout Groups in Compose
Using Basic Layouts in Jetpack Compose
Linear Layouts
Using Boxes
Scaffold
Key Points
Where to Go From Here?
Chapter 4: Building Lists With Jetpack Compose
Using Vertical Scrolling Modifiers
Using Horizontal Scrolling Modifiers
Lists in Compose
Grids in Compose
Key Points
Where to Go From Here?
Chapter 5: Combining Composables
Application Features
Project Overview
Thinking in Compose
Bottom-up Approach
Creating the Note Composable
Building the App Drawer Composable
Putting all the Pieces Together
Key Points
Where to Go From Here?
Chapter 6: Using Compose Modifiers
Modifiers
Chaining Modifiers
Rounding out the NoteColor
Adding NoteColor to Note
Adding a Background to Note
Centering Text & Checkbox Composables
Centering NoteColor
Taking Advantage of the Modifier Parameter
Styling Title & Content
Adding the Color Composable
Key Points
Where to Go From Here?
Chapter 7: Managing State in Compose
Understanding State
Handling State With Android UI Toolkit
Handling State With Unidirectional Data Flow
Compose & ViewModel
Creating the Notes Screen
Creating the App Bar
Stateless Composables
Extracting a Stateless Composable
Key Points
Chapter 8: Applying Material Design to Compose
Opening the Notes Screen
Adding Scaffold to Notes Screen
Adding the FAB
Adding an Entry Point to Save Note Screen
Adding the Top Bar
Opening the Save Note Screen in Editing Mode
Creating a Content Composable
Wrapping up the Save Note Screen
Using Material Design Composables in the Notes Screen
Theming in Compose
Key Points
Where to Go From Here?
Chapter 9: Using ConstraintSets in Composables
Understanding ConstraintLayout
ConstraintLayout in Jetpack Compose
Implementing the App Drawer Layout
Implementing the App Drawer’s Body
Advanced Features of ConstraintLayout
Key Points
Chapter 10: Building Complex UI in Jetpack Compose
Building the Home Screen
Building the Subreddits Screen
Key Points
Chapter 11: Reacting to Compose Lifecycle
Events in Compose
Implementing the Community Chooser
Effects in Compose
Migrate Effects
Key Points
Where to Go From Here?
Chapter 12: Animating Properties Using Compose
Building JoinButton
Adding JoinButton to Post
Animating the JoinButton Background
Using Transitions to Animate JoinButton
Animating Composable Content
Key Points
Chapter 13: Adding View Compatibility
Introducing the Chat Screen and the Trending View
Using Composables With the View Framework
Using View With Jetpack Compose
Key Points
Where to Go From Here?
Chapter 14: UI Tests in Jetpack Compose
Loading the Starter Project
Behind the Scenes of UI Tests in Jetpack Compose
Testing UI Components in Jetpack Compose
Writing Tests for Screens
Writing Tests for Hybrid Screens
Key Points
Chapter 15: Accessibility in Jetpack Compose
Semantic Properties
Implementing Accessible Touch Target Size
Adding Visual Element Descriptions
Adding a Click Label
Implementing Custom Actions
Navigating Through Headings
Custom Merging
Lifting Toggle Behavior
Adding State Descriptions
Key Points
Where to Go From Here?
Chapter 16: Creating Widgets Using Jetpack Glance
Introducing Jetpack Glance
Defining Essential Characteristics of Your App Widget
Creating the Hello Glance Widget
Displaying the Widget on the Home Screen
Adding Subreddits to the Widget
Handling Widget Actions
Connecting the Widget With the JetReddit App
Key Points
Where to Go From here?
Chapter 17: Keeping up to Date With Jetpack Compose
Official Sources
Community Resources
Platforms of the Future
Key Points
Conclusion
Appendix A: ViewGroups / Widgets to Jetpack Compose Cheatsheet
ViewGroup and Their Equivalents
Build Beautiful Apps With Jetpack Compose
Jetpack Compose is hyping up everyone in the Android UI toolkit world. This completely new and modern solution to building declarative user interfaces provides more opportunity than ever to create beautiful, reactive and animated apps.
However, because of its new status, Jetpack Compose is lacking one of the most important pieces of successful software: detailed documentation. That’s why we’ve prepared a whole book’s worth of documentation for you!
Jetpack Compose By Tutorials is here to help, by showing you exactly how Compose works, what its fundamental components are and how you can use them to build complex real-world apps!
Who this book is for
This book is for all Android developers who have experience with the legacy UI Toolkit through XML and View components, but who are looking for a fresh, reusable, clean and easy-to-use solution to reduce their boilerplate code while building stunning user interfaces.
Topics covered in Jetpack Compose by Tutorials:
Fundamentals: Core Jetpack Compose elements and functions
Combining components: Mixing different layouts and building beautiful interfaces
State Management: State wrappers, LiveData observables and UI recomposition
UI Styling: Modifiers for size, shape, colors, background, padding and alignment
User Interaction: Different click, touch and scroll listeners and their handlers
Animations: State changes, value animations and complex transitions
UI Testing: Learn how to test your Jetpack Compose code
Accessibility: Learn how to support Accessibility using Jetpack Compose
One thing you can count on: After reading this book, you’ll be prepared to tackle any design specification and build it in your Android apps using Jetpack Compose. You’ll make your apps really stand out by adding different modifiers and Material Design components, as well as animations.