Customizing Composables

Coda Pizza is off to a great start. You are ready to start making your composables look just the way you want them to. Previously, you accomplished this using XML attributes. In Compose, function parameters take the place of the attributes that you are accustomed to in XML.

You have already seen a few parameters on the built-in composables you have been using: text for the Text composable and checked and onCheckedChange for Checkbox. You are also free to add parameters to your own composables.

Declaring inputs on a composable function

Think about the ToppingCell composable. It will need to take in three pieces of information: the name of the topping, the placement of the topping, and what to do when ...

Get Android Programming: The Big Nerd Ranch Guide, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.