{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

BottomAppBarDefaults

public static class BottomAppBarDefaults


Contains default values used for the bottom app bar implementations.

Summary

Public fields

static @NonNull BottomAppBarDefaults

Public methods

final @NonNull BottomAppBarScrollBehavior
@ExperimentalMaterial3Api
@Composable
exitAlwaysScrollBehavior(
    @NonNull BottomAppBarState state,
    @NonNull Function0<@NonNull Boolean> canScroll,
    AnimationSpec<@NonNull Float> snapAnimationSpec,
    DecayAnimationSpec<@NonNull Float> flingAnimationSpec
)

Returns a BottomAppBarScrollBehavior.

final @NonNull Color

The color of a BottomAppBar's FloatingActionButton

final @NonNull Color

Default color used for BottomAppBar container

final @NonNull Dp

Default elevation used for BottomAppBar

final @NonNull PaddingValues

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

final @NonNull WindowInsets

Default insets that will be used and consumed by BottomAppBar.

Public fields

INSTANCE

public static @NonNull BottomAppBarDefaults INSTANCE

Public methods

exitAlwaysScrollBehavior

@ExperimentalMaterial3Api
@Composable
public final @NonNull BottomAppBarScrollBehavior exitAlwaysScrollBehavior(
    @NonNull BottomAppBarState state,
    @NonNull Function0<@NonNull Boolean> canScroll,
    AnimationSpec<@NonNull Float> snapAnimationSpec,
    DecayAnimationSpec<@NonNull Float> flingAnimationSpec
)

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.

Parameters
@NonNull BottomAppBarState 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.

@NonNull Function0<@NonNull Boolean> canScroll

a callback used to determine whether scroll events are to be handled by this ExitAlwaysScrollBehavior

AnimationSpec<@NonNull Float> 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

DecayAnimationSpec<@NonNull Float> flingAnimationSpec

an optional DecayAnimationSpec that defined how to fling the bottom app bar when the user flings the app bar itself, or the content below it

getBottomAppBarFabColor

@Composable
public final @NonNull Color getBottomAppBarFabColor()

The color of a BottomAppBar's FloatingActionButton

getContainerColor

@Composable
public final @NonNull Color getContainerColor()

Default color used for BottomAppBar container

getContainerElevation

public final @NonNull Dp getContainerElevation()

Default elevation used for BottomAppBar

getContentPadding

public final @NonNull PaddingValues getContentPadding()

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

getWindowInsets

@Composable
public final @NonNull WindowInsets getWindowInsets()

Default insets that will be used and consumed by BottomAppBar.