public object BottomAppBarDefaults
Contains default values used for the bottom app bar implementations.
Properties
containerColor
public val containerColor: Color
Default color used for BottomAppBar container
ContainerElevation
public val ContainerElevation: Dp = 0.dp
Default elevation used for BottomAppBar
ContentPadding
public val ContentPadding: PaddingValues =
PaddingValues(
start = BottomAppBarHorizontalPadding,
top = BottomAppBarVerticalPadding,
end = BottomAppBarHorizontalPadding,
)
Default padding used for BottomAppBar when content are default size (24dp) icons in IconButton that meet the minimum touch target (48.dp).
windowInsets
public val windowInsets: WindowInsets
Default insets that will be used and consumed by BottomAppBar.
bottomAppBarFabColor
public val bottomAppBarFabColor: Color
The color of a BottomAppBar's FloatingActionButton
FlexibleContentPadding
public val FlexibleContentPadding: PaddingValues =
PaddingValues(
start = DockedToolbarTokens.ContainerLeadingSpace,
end = DockedToolbarTokens.ContainerTrailingSpace,
)
Default padding used for FlexibleBottomAppBar.
FlexibleBottomAppBarHeight
public val FlexibleBottomAppBarHeight: Dp = DockedToolbarTokens.ContainerHeight
Default height of a flexible FlexibleBottomAppBar. The height here represents the height of the bottom app bar in its expanded state.
FlexibleHorizontalArrangement
public val FlexibleHorizontalArrangement: Arrangement.Horizontal = Arrangement.SpaceBetween
A default Arrangement that will be used to space a FlexibleBottomAppBar's content.
FlexibleFixedHorizontalArrangement
public val FlexibleFixedHorizontalArrangement: Arrangement.Horizontal =
Arrangement.spacedBy(DockedToolbarTokens.ContainerMaxSpacing, Alignment.CenterHorizontally)
An Arrangement that will be used to space FlexibleBottomAppBar's with a fixed spacing.
snapAnimationSpec
public val snapAnimationSpec: AnimationSpec<Float>
Default AnimationSpec that defines how the bottom app bar snaps to either fully collapsed or fully extended state when a fling or a drag scrolled it into an intermediate position.
flingAnimationSpec
public val flingAnimationSpec: DecayAnimationSpec<Float>
Default DecayAnimationSpec that defines how to fling the bottom app bar when the user flings the app bar itself, or the scrollable content.
Functions
exitAlwaysScrollBehavior
@Composable
public fun exitAlwaysScrollBehavior(
state: BottomAppBarState = rememberBottomAppBarState(),
canScroll: () -> Boolean = { true },
snapAnimationSpec: AnimationSpec<Float>? = BottomAppBarDefaults.snapAnimationSpec,
flingAnimationSpec: DecayAnimationSpec<Float>? = BottomAppBarDefaults.flingAnimationSpec,
): BottomAppBarScrollBehavior
Returns a BottomAppBarScrollBehavior. A bottom app bar that is set up with this BottomAppBarScrollBehavior will immediately collapse when the content is pulled up, and will immediately appear when the content is pulled down. Note: Scroll behavior is automatically disabled when a touch exploration service (e.g. TalkBack) is active to preserve accessibility.
The returned BottomAppBarScrollBehavior is remembered across compositions.
Parameters
| state | the state object to be used to control or observe the bottom app bar's scroll state. See rememberBottomAppBarState for a state that is remembered across compositions. |
| canScroll | a callback used to determine whether scroll events are to be handled by this ExitAlwaysScrollBehavior |
| snapAnimationSpec | an optional AnimationSpec that defines how the bottom app bar snaps to either fully collapsed or fully extended state when a fling or a drag scrolled it into an intermediate position. If null is provided, the app bar will not snap and will remain in its current state. |
| flingAnimationSpec | an optional DecayAnimationSpec that defines how to fling the bottom app bar when the user flings the app bar itself, or the scrollable content. If null is provided, the app bar will not continue to animate its height based on the scroll velocity. |