
Users can select one flavor out of a choice of possible flavors. The app uses what's known as radio buttons to display different options. Choose flavor screenĪfter selecting the quantity, the app prompts the user to select a cupcake flavor. The custom buttons are implemented by the SelectQuantityButton composable, which is also in StartOrderScreen.kt. The screen consists of a single column, with an image and text, along with three custom buttons to order different quantities of cupcakes. In code, this is represented by the StartOrderScreen composable in StartOrderScreen.kt. The first screen presents the user with three buttons that correspond to the quantity of cupcakes to order. Instead of all the content displaying on a single screen, the app has four separate screens, and the user can navigate through each screen while ordering cupcakes. The Cupcake app is a bit different than the apps you've worked with so far. Note: The starter code is in the starter branch of the downloaded repository. $ cd basic-android-kotlin-compose-training-cupcake To get started, download the starter code:Īlternatively, you can clone the GitHub repository for the code: $ git clone An internet connection to download the starter code.You'll implement navigation in a multiscreen app.Customize the AppBar, including the title and back button.Use intents to share data with another app.Manipulate the backstack to navigate to previous screens.Navigate between screens using a NavHostController.Create a NavHost composable to define routes and screens in your app.Familiarity with basic Row and Column layouts in Compose.Familiarity with the Kotlin language, including function types, lambdas, and scope functions.
#Scaffold resource how to
This codelab introduces the essentials of the Navigation Compose component, how to make the AppBar responsive, and how to send data from your app to another app using intents-all while demonstrating best practices in an increasingly complex app. The Navigation Compose component allows you to easily build multiscreen apps in Compose using a declarative approach, just like building user interfaces.
#Scaffold resource android
In modern Android development, multiscreen apps are created using the Jetpack Navigation component. For example, the Settings app has many pages of content spread across different screens.

However, a lot of the apps you use probably have multiple screens that you can navigate through. Up until this point, the apps you've worked on consisted of a single screen.
