Integrating toolbars and menus
Early Android versions did not know about action or app bars. They were introduced with API level 11 (Honeycomb). The options menu, on the other hand, has been around since the beginning, but it was opened by pressing a dedicated hardware button and shown at the bottom of the screen. For Android 3, it moved to the top and became a vertical list. Some elements could be made available permanently as actions. In a way, the options menu and the action bar merged. While all the aspects of the action bar were originally handled by the hosting activity, the AppCompat
support library introduced an alternative implementation (getSupportActionBar()
).
Using Scaffold() to structure your screen
Jetpack Compose includes several app bar implementations that follow Material You specifications. They can be added to a Compose UI through Scaffold()
, a composable function that acts as an app frame or skeleton. The following code snippet is the root of the ComposeUnitConverter...