androidx.compose.material3
TopAppBarScrollBehavior
Interface
No hand-written docs yet.
A TopAppBarScrollBehavior defines how an app bar should behave when the content under it is scrolled.
interface TopAppBarScrollBehavior
How to get one
Ready-made values and functions that return it
TopAppBarDefaults:pinnedScrollBehavior(),enterAlwaysScrollBehavior(),exitUntilCollapsedScrollBehavior()
Used by
Parameters that take a TopAppBarScrollBehavior.
CenterAlignedTopAppBar(scrollBehavior)LargeFlexibleTopAppBar(scrollBehavior)LargeTopAppBar(scrollBehavior)MediumFlexibleTopAppBar(scrollBehavior)MediumTopAppBar(scrollBehavior)TopAppBar(scrollBehavior)TwoRowsTopAppBar(scrollBehavior)
Properties
state
val state: TopAppBarState
A TopAppBarState that is attached to this behavior and is read and updated when scrolling happens.
isPinned
val isPinned: Boolean
Indicates whether the top app bar is pinned.
snapAnimationSpec
val snapAnimationSpec: AnimationSpec<Float>?
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. If null is provided, the app bar will not snap and will remain in its current state.
flingAnimationSpec
val flingAnimationSpec: DecayAnimationSpec<Float>?
An optional DecayAnimationSpec that defines how to fling the top app bar when the user flings the app bar itself, or the scrollable content. If null is provided, the app bar will not continue to animate its height based on the scroll velocity.
nestedScrollConnection
val nestedScrollConnection: NestedScrollConnection
A NestedScrollConnection that should be attached to a androidx.compose.ui.input.nestedscroll.nestedScroll in order to keep track of the scroll events.
Library docs
A TopAppBarScrollBehavior defines how an app bar should behave when the content under it is scrolled.