Compose Component

SpatialTwoRowsTopAppBar

XR-specific TwoRowsTopAppBar that displays a two-rows top app bar inside a top-aligned Orbiter.

SpatialTwoRowsTopAppBar

Source set: Android
@Composable
public fun SpatialTwoRowsTopAppBar(
    title: @Composable (expanded: Boolean) -> Unit,
    modifier: Modifier = Modifier,
    subtitle: (@Composable (expanded: Boolean) -> Unit)? = null,
    navigationIcon: @Composable () -> Unit = {},
    actions: @Composable RowScope.() -> Unit = {},
    titleHorizontalAlignment: Alignment.Horizontal = Alignment.Start,
    collapsedHeight: Dp = Dp.Unspecified,
    expandedHeight: Dp = Dp.Unspecified,
    windowInsets: WindowInsets = TopAppBarDefaults.windowInsets,
    colors: TopAppBarColors = TopAppBarDefaults.topAppBarColors(),
    scrollBehavior: TopAppBarScrollBehavior? = null,
)

Parameters

title the title to be displayed in the top app bar
modifier the Modifier to be applied to this top app bar
subtitle optional subtitle to be displayed in the top app bar
navigationIcon optional navigation icon to be displayed at the start of the top app bar
actions optional actions to be displayed at the end of the top app bar
titleHorizontalAlignment the horizontal alignment of the title
collapsedHeight the collapsed height of the top app bar
expandedHeight the expanded height of the top app bar
windowInsets a window insets of the top app bar
colors TopAppBarColors that will be used to resolve the colors used for this top app bar
scrollBehavior a TopAppBarScrollBehavior
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: