enterAlwaysSearchBarScrollBehavior

@Composable
fun enterAlwaysSearchBarScrollBehavior(initialOffset: Float = 0.0f, initialOffsetLimit: Float = -Float.MAX_VALUE, initialContentOffset: Float = 0.0f, canScroll: () -> Boolean = { true }, snapAnimationSpec: AnimationSpec<Float> = MotionSchemeKeyTokens.DefaultEffects.value(), flingAnimationSpec: DecayAnimationSpec<Float> = rememberSplineBasedDecay(), reverseLayout: Boolean = false): SearchBarScrollBehavior

Returns a SearchBarScrollBehavior. A search bar that is set up with this behavior will immediately scroll upward off-screen when the content is pulled up, and will immediately appear when the content is pulled down.

The returned SearchBarScrollBehavior is remembered across compositions.

Parameters

initialOffset

the initial value for SearchBarScrollBehavior.scrollOffset. Should be between initialOffsetLimit and 0.

initialOffsetLimit

the initial value for SearchBarScrollBehavior.scrollOffsetLimit, which represents the pixel limit that a search bar is allowed to scroll off-screen when the content is scrolled.

initialContentOffset
canScroll

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

snapAnimationSpec

an AnimationSpec that defines how the search bar's scroll offset snaps to either its limit or 0 when a fling or a drag scrolls it into an intermediate position.

flingAnimationSpec

a DecayAnimationSpec that defines how to fling the search bar when the user flings the search bar itself, or the content beneath it.

reverseLayout

indicates that this behavior is applied to a scrollable content that has a reversed direction of scrolling and layout.