Android Programming: The Big Nerd Ranch Guide, 5th Edition
by Bryan Sills, Brian Gardner, Kristin Marsicano, Chris Stewart
Building Screens with Composables
You have seen a number of composables up to this point, with a range of complexity. On the simple end, you have seen atomic components like Row and Text. And you have built ToppingCell, a more complex composable that is built on top of other composables.
It is also possible to create a composable that renders the entire screen. In fact, the setContent function you called in MainActivity is a lambda that does just that. Because there are no limitations about what a single composable can do, you do not need another component like a Fragment to perform navigation. (You can, however, enlist the help of the AndroidX Navigation library, which has a Jetpack Compose flavor.)
Under Jetpack Compose, composables ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access