TopAppBarDefaults

Contains default values used for the top app bar implementations.

Properties

Link copied to clipboard

The default height of a LargeTopAppBar when collapsed by a TopAppBarScrollBehavior.

Link copied to clipboard

The default expanded height of a LargeTopAppBar.

Link copied to clipboard

The default height of a MediumTopAppBar when collapsed by a TopAppBarScrollBehavior.

Link copied to clipboard

The default expanded height of a MediumTopAppBar.

Link copied to clipboard

The default expanded height of a TopAppBar and the CenterAlignedTopAppBar.

Link copied to clipboard
@get:Composable
val windowInsets: WindowInsets

Default insets to be used and consumed by the top app bars

Functions

Link copied to clipboard
@Composable
fun centerAlignedTopAppBarColors(containerColor: Color = Color.Unspecified, scrolledContainerColor: Color = Color.Unspecified, navigationIconContentColor: Color = Color.Unspecified, titleContentColor: Color = Color.Unspecified, actionIconContentColor: Color = Color.Unspecified): TopAppBarColors

Creates a TopAppBarColors for CenterAlignedTopAppBars. The default implementation animates between the provided colors according to the Material Design specification.

Link copied to clipboard
@Composable
fun enterAlwaysScrollBehavior(state: TopAppBarState = rememberTopAppBarState(), canScroll: () -> Boolean = { true }, snapAnimationSpec: AnimationSpec<Float>? = spring(stiffness = Spring.StiffnessMediumLow), flingAnimationSpec: DecayAnimationSpec<Float>? = rememberSplineBasedDecay()): TopAppBarScrollBehavior

Returns a TopAppBarScrollBehavior. A top app bar that is set up with this TopAppBarScrollBehavior will immediately collapse when the content is pulled up, and will immediately appear when the content is pulled down.

Link copied to clipboard
@Composable
fun exitUntilCollapsedScrollBehavior(state: TopAppBarState = rememberTopAppBarState(), canScroll: () -> Boolean = { true }, snapAnimationSpec: AnimationSpec<Float>? = spring(stiffness = Spring.StiffnessMediumLow), flingAnimationSpec: DecayAnimationSpec<Float>? = rememberSplineBasedDecay()): TopAppBarScrollBehavior

Returns a TopAppBarScrollBehavior that adjusts its properties to affect the colors and height of the top app bar.

Link copied to clipboard
@Composable
fun largeTopAppBarColors(containerColor: Color = Color.Unspecified, scrolledContainerColor: Color = Color.Unspecified, navigationIconContentColor: Color = Color.Unspecified, titleContentColor: Color = Color.Unspecified, actionIconContentColor: Color = Color.Unspecified): TopAppBarColors

Creates a TopAppBarColors for LargeTopAppBars. The default implementation interpolates between the provided colors as the top app bar scrolls according to the Material Design specification.

Link copied to clipboard
@Composable
fun mediumTopAppBarColors(containerColor: Color = Color.Unspecified, scrolledContainerColor: Color = Color.Unspecified, navigationIconContentColor: Color = Color.Unspecified, titleContentColor: Color = Color.Unspecified, actionIconContentColor: Color = Color.Unspecified): TopAppBarColors

Creates a TopAppBarColors for MediumTopAppBars. The default implementation interpolates between the provided colors as the top app bar scrolls according to the Material Design specification.

Link copied to clipboard
@Composable
fun pinnedScrollBehavior(state: TopAppBarState = rememberTopAppBarState(), canScroll: () -> Boolean = { true }): TopAppBarScrollBehavior

Returns a pinned TopAppBarScrollBehavior that tracks nested-scroll callbacks and updates its TopAppBarState.contentOffset accordingly.

Link copied to clipboard
@Composable
fun topAppBarColors(containerColor: Color = Color.Unspecified, scrolledContainerColor: Color = Color.Unspecified, navigationIconContentColor: Color = Color.Unspecified, titleContentColor: Color = Color.Unspecified, actionIconContentColor: Color = Color.Unspecified): TopAppBarColors

Creates a TopAppBarColors for small TopAppBar. The default implementation animates between the provided colors according to the Material Design specification.