enterAlways

fun enterAlways(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.

Parameters

state

the state object to be used to control or observe the top app bar's scroll state. See also rememberTopAppBarState to create a state that is remembered across compositions.

canScroll

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

snapAnimationSpec

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

flingAnimationSpec

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