FloatingAppBarDefaults


Contains default values used for the floating app bar implementations.

Summary

Public functions

FloatingAppBarScrollBehavior
@ExperimentalMaterial3ExpressiveApi
@Composable
exitAlwaysScrollBehavior(
    exitDirection: FloatingAppBarExitDirection,
    state: FloatingAppBarState,
    snapAnimationSpec: AnimationSpec<Float>,
    flingAnimationSpec: DecayAnimationSpec<Float>
)

Returns a FloatingAppBarScrollBehavior.

Cmn
EnterTransition

Default enter transition used for HorizontalFloatingAppBar when expanding

Cmn
ExitTransition

Default exit transition used for HorizontalFloatingAppBar when shrinking

Cmn
EnterTransition

Default enter transition used for VerticalFloatingAppBar when expanding

Cmn
ExitTransition

Default exit transition used for VerticalFloatingAppBar when shrinking

Cmn

Public properties

Color

Default color used for HorizontalFloatingAppBar and VerticalFloatingAppBar container

Cmn
Dp

Default elevation used for HorizontalFloatingAppBar and VerticalFloatingAppBar

Cmn
Shape

Default shape used for HorizontalFloatingAppBar and VerticalFloatingAppBar

Cmn
Dp

Default size used for HorizontalFloatingAppBar and VerticalFloatingAppBar container

Cmn
PaddingValues

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

Cmn
Dp

Default offset from the edge of the screen used for HorizontalFloatingAppBar and VerticalFloatingAppBar.

Cmn

Public functions

exitAlwaysScrollBehavior

@ExperimentalMaterial3ExpressiveApi
@Composable
fun exitAlwaysScrollBehavior(
    exitDirection: FloatingAppBarExitDirection,
    state: FloatingAppBarState = rememberFloatingAppBarState(),
    snapAnimationSpec: AnimationSpec<Float> = MotionSchemeKeyTokens.DefaultEffects.value(),
    flingAnimationSpec: DecayAnimationSpec<Float> = rememberSplineBasedDecay()
): FloatingAppBarScrollBehavior

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

Parameters
exitDirection: FloatingAppBarExitDirection

indicates the direction towards which the floating app bar exits the screen

state: FloatingAppBarState = rememberFloatingAppBarState()

the state object to be used to control or observe the floating app bar's scroll state. See rememberFloatingAppBarState for a state that is remembered across compositions.

snapAnimationSpec: AnimationSpec<Float> = MotionSchemeKeyTokens.DefaultEffects.value()

an AnimationSpec that defines how the floating app bar snaps to either fully collapsed or fully extended state when a fling or a drag scrolled it into an intermediate position

flingAnimationSpec: DecayAnimationSpec<Float> = rememberSplineBasedDecay()

an DecayAnimationSpec that defines how to fling the floating app bar when the user flings the app bar itself, or the content below it

horizontalEnterTransition

@Composable
fun horizontalEnterTransition(expandFrom: Alignment.Horizontal): EnterTransition

Default enter transition used for HorizontalFloatingAppBar when expanding

horizontalExitTransition

@Composable
fun horizontalExitTransition(shrinkTowards: Alignment.Horizontal): ExitTransition

Default exit transition used for HorizontalFloatingAppBar when shrinking

verticalEnterTransition

@Composable
fun verticalEnterTransition(expandFrom: Alignment.Vertical): EnterTransition

Default enter transition used for VerticalFloatingAppBar when expanding

verticalExitTransition

@Composable
fun verticalExitTransition(shrinkTowards: Alignment.Vertical): ExitTransition

Default exit transition used for VerticalFloatingAppBar when shrinking

Public properties

ContainerColor

val ContainerColorColor

Default color used for HorizontalFloatingAppBar and VerticalFloatingAppBar container

ContainerElevation

val ContainerElevationDp

Default elevation used for HorizontalFloatingAppBar and VerticalFloatingAppBar

ContainerShape

val ContainerShapeShape

Default shape used for HorizontalFloatingAppBar and VerticalFloatingAppBar

ContainerSize

val ContainerSizeDp

Default size used for HorizontalFloatingAppBar and VerticalFloatingAppBar container

ContentPadding

val ContentPaddingPaddingValues

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

ScreenOffset

val ScreenOffsetDp

Default offset from the edge of the screen used for HorizontalFloatingAppBar and VerticalFloatingAppBar.