ParallaxHeaderConfig

constructor(height: HeaderHeight, gradient: Brush?, isExpandedWhenFirstDisplayed: Boolean = true, parallaxMultiplier: Float = ParallaxToolbarDefaults.HeaderParallaxMultiplier, snapOnRelease: Boolean = false, scrollMode: ScrollMode = ScrollMode.ExitUntilCollapsed, fadeOnCollapse: Boolean = true, stretchEnabled: Boolean = false, stretchTriggerDistance: Dp = ParallaxToolbarDefaults.StretchTriggerDistance, animationSpec: AnimationSpec<Float> = ParallaxToolbarDefaults.AnimationSpec, snapThreshold: Float = ParallaxToolbarDefaults.SnapThreshold)(source)

Parameters

parallaxMultiplier

How much of the scroll distance the header content moves by. 0f pins it, 1f scrolls it with the body, 0.5f is the classic parallax.

snapOnRelease

When a drag or fling ends with the header partly collapsed, settle it to a resting position instead of leaving it there. A fling settles in its direction; a plain release settles by snapThreshold.

snapThreshold

Collapse progress, 0f..1f, at or past which a plain release settles collapsed rather than expanded. 0.5f settles to the nearer position; 0.75f favors expanded. In ScrollMode.EnterAlwaysCollapsed the same threshold applies to the toolbar's exit.

scrollMode

How the header and toolbar react to the body scrolling; see ScrollMode.

fadeOnCollapse

Fade the whole header out as it collapses. Turn off, together with a parallaxMultiplier of 0f, when header elements use the per-element modifiers of ParallaxToolbarScope instead.

stretchEnabled

Let a downward drag past the top stretch the header, which zooms its content and pushes the body down, then springs back on release. Pair with the layout's onStretchTrigger for pull-to-refresh.

stretchTriggerDistance

How far the header must be stretched when released for onStretchTrigger to fire.

animationSpec

Animation used when the header settles on its own: snaps, stretch releases, and collapse()/expand() when they are not given a spec. Use a snap() or a short tween to honor a reduced-motion setting.