FloatingToolbarDefaults

Contains default values used for the floating toolbar implementations.

Properties

Link copied to clipboard

Default collapsed elevation used for HorizontalFloatingToolbar and VerticalFloatingToolbar

Link copied to clipboard

Default collapsed elevation used for HorizontalFloatingToolbar and VerticalFloatingToolbar with FAB.

Link copied to clipboard
Link copied to clipboard

Default expanded elevation used for HorizontalFloatingToolbar and VerticalFloatingToolbar with FAB.

Link copied to clipboard
@get:Composable
val ContainerShape: Shape
Link copied to clipboard

Default size used for HorizontalFloatingToolbar and VerticalFloatingToolbar container

Link copied to clipboard
val ContentPadding: PaddingValues

Default padding used for HorizontalFloatingToolbar and VerticalFloatingToolbar when content are default size (24dp) icons in IconButton that meet the minimum touch target (48.dp).

Link copied to clipboard
val ScreenOffset: Dp

Default offset from the edge of the screen used for HorizontalFloatingToolbar and VerticalFloatingToolbar.

Link copied to clipboard

A default threshold in Dp for the content's scrolling that defines when the toolbar should be collapsed or expanded.

Functions

Link copied to clipboard
@Composable
fun <T> animationSpec(): FiniteAnimationSpec<T>

Returns a default animation spec used for HorizontalFloatingToolbars and VerticalFloatingToolbars.

Link copied to clipboard
@Composable
fun exitAlwaysScrollBehavior(exitDirection: FloatingToolbarExitDirection, state: FloatingToolbarState = rememberFloatingToolbarState(), snapAnimationSpec: AnimationSpec<Float> = MotionSchemeKeyTokens.DefaultEffects.value(), flingAnimationSpec: DecayAnimationSpec<Float> = rememberSplineBasedDecay()): FloatingToolbarScrollBehavior

Returns a FloatingToolbarScrollBehavior. A floating toolbar that is set up with this FloatingToolbarScrollBehavior will immediately collapse when the content is pulled up, and will immediately appear when the content is pulled down.

Link copied to clipboard
fun Modifier.floatingToolbarVerticalNestedScroll(expanded: Boolean, onExpand: () -> Unit, onCollapse: () -> Unit, expandScrollDistanceThreshold: Dp = ScrollDistanceThreshold, collapseScrollDistanceThreshold: Dp = ScrollDistanceThreshold, reverseLayout: Boolean = false): Modifier

This Modifier tracks vertical scroll events on the scrolling container that a floating toolbar appears above. It then calls onExpand and onCollapse to adjust the toolbar's state based on the scroll direction and distance.

Link copied to clipboard
@Composable
fun horizontalEnterTransition(expandFrom: Alignment.Horizontal): EnterTransition

Default enter transition used for HorizontalFloatingToolbar when expanding

Link copied to clipboard
@Composable
fun horizontalExitTransition(shrinkTowards: Alignment.Horizontal): ExitTransition

Default exit transition used for HorizontalFloatingToolbar when shrinking

Link copied to clipboard
@Composable
fun StandardFloatingActionButton(onClick: () -> Unit, modifier: Modifier = Modifier, shape: Shape = FloatingActionButtonDefaults.shape, containerColor: Color = standardFloatingToolbarColors().fabContainerColor, contentColor: Color = standardFloatingToolbarColors().fabContentColor, interactionSource: MutableInteractionSource? = null, content: @Composable () -> Unit)

Creates a FloatingActionButton that represents a toolbar floating action button with standard colors.

Link copied to clipboard
@Composable
fun standardFloatingToolbarColors(toolbarContainerColor: Color = Color.Unspecified, toolbarContentColor: Color = Color.Unspecified, fabContainerColor: Color = Color.Unspecified, fabContentColor: Color = Color.Unspecified): FloatingToolbarColors

Creates a FloatingToolbarColors that represents the default standard colors used in the various floating toolbars.

Link copied to clipboard
@Composable
fun verticalEnterTransition(expandFrom: Alignment.Vertical): EnterTransition

Default enter transition used for VerticalFloatingToolbar when expanding

Link copied to clipboard
@Composable
fun verticalExitTransition(shrinkTowards: Alignment.Vertical): ExitTransition

Default exit transition used for VerticalFloatingToolbar when shrinking

Link copied to clipboard
@Composable
fun VibrantFloatingActionButton(onClick: () -> Unit, modifier: Modifier = Modifier, shape: Shape = FloatingActionButtonDefaults.shape, containerColor: Color = vibrantFloatingToolbarColors().fabContainerColor, contentColor: Color = vibrantFloatingToolbarColors().fabContentColor, interactionSource: MutableInteractionSource? = null, content: @Composable () -> Unit)

Creates a FloatingActionButton that represents a toolbar floating action button with vibrant colors.

Link copied to clipboard
@Composable
fun vibrantFloatingToolbarColors(toolbarContainerColor: Color = Color.Unspecified, toolbarContentColor: Color = Color.Unspecified, fabContainerColor: Color = Color.Unspecified, fabContentColor: Color = Color.Unspecified): FloatingToolbarColors

Creates a FloatingToolbarColors that represents the default vibrant colors used in the various floating toolbars.