exitUntilCollapsed

fun exitUntilCollapsed(state: TopAppBarState = rememberTopAppBarState(), canScroll: () -> Boolean = { true }, snapAnimationSpec: AnimationSpec<Float>? = spring(stiffness = Spring.StiffnessMediumLow), flingAnimationSpec: DecayAnimationSpec<Float>? = rememberSplineBasedDecay()): TopAppBarScrollBehavior

Returns a TopAppBarScrollBehavior that adjusts its properties to affect the colors and height of the top app bar.

A top app bar that is set up with this TopAppBarScrollBehavior will immediately collapse when the nested content is pulled up, and will expand back the collapsed area when the content is pulled all the way down.

Parameters

decayAnimationSpec

a DecayAnimationSpec that will be used by the top app bar motion when the user flings the content. Preferably, this should match the animation spec used by the scrollable content. See also androidx.compose.animation.rememberSplineBasedDecay for a default DecayAnimationSpec that can be used with this behavior.

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 ExitUntilCollapsedScrollBehavior

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