Android Programming: The Big Nerd Ranch Guide, 5th Edition
by Bryan Sills, Brian Gardner, Kristin Marsicano, Chris Stewart
Scaffold and TopAppBar
App bars are an important part of your app, both visually and for navigation and menus. It is a good idea for Coda Pizza to include an app bar, even if it is just to show a title.
To reinstate your app bar, you will use the TopAppBar composable. TopAppBar accepts several composables as inputs, each of which can add content in a specific region of the app bar. You will only set the title parameter to show the application name, matching the default behavior of the automatically provided app bar – but with the benefit of using your Compose theme.
If you wanted, you could also provide a parameter for a navigationIcon to add an element to be the Up button. There is also a parameter called actions, which takes ...
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