Parallax Toolbar Scope
Receiver of every content slot of ComposeParallaxToolbarLayout. Slots still receive the collapsed flag as their parameter; this scope adds the continuous collapseFraction for effects that should follow the scroll, and modifiers that give individual elements their own collapse behavior.
Reading collapseFraction in composition recomposes the slot on every scroll frame. For per-frame visuals prefer the modifiers below, or read it inside Modifier.graphicsLayer { } or drawBehind { }, which only re-run that block.
Inheritors
Properties
0f while fully expanded, 1f once fully collapsed.
Measured geometry of the layout; see ParallaxToolbarLayoutInfo.
The layout's state, for ParallaxToolbarState.collapse and friends.
Functions
Interpolates the element's alpha from expandedAlpha to collapsedAlpha with the collapse.
Glides the element from its place in the expanded header to its place in the toolbar, scaling toward collapsedScale on the way. Meant for the overlayContent slot, whose elements sit above the body and the toolbar, so the element stays visible once collapsed.
Moves the element up by ratio of the collapse distance as the header collapses. 0f keeps it still, 1f moves it with the body. Pair with headerConfig(parallaxMultiplier = 0f) when elements should each set their own ratio.
Keeps the element in view while the header collapses: it stays put until the header's bottom edge reaches it, then rides up with that edge. For elements at the bottom of the header, such as a search field or a chip row, that should stay visible for as long as possible. The element ignores the header's parallaxMultiplier.
Scales the element toward collapsedScale about origin as the header collapses.