ParallaxToolbarDefaults

Default values and factory methods for ComposeParallaxToolbarLayout.

Properties

Link copied to clipboard

Spec used for snaps, stretch releases and collapse()/expand() unless overridden.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
const val SnapThreshold: Float = 0.5f

Snap threshold that settles a plain release to the nearer resting position.

Link copied to clipboard
Link copied to clipboard
const val TitleCollapsedScale: Float = 1.0f
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Insets the toolbar and body stay inside of by default: the top system bar plus the display cutout, on the top and both sides. The same set Material's top app bar uses. Zero on desktop and web.

Functions

Link copied to clipboard
fun bodyConfig(minBottomSpacerHeight: Dp = BodyMinBottomSpacing, backgroundColor: Color = Color.Unspecified): ParallaxBodyConfig
Link copied to clipboard
fun headerConfig(height: HeaderHeight = HeaderHeight.Fixed(HeaderHeightDp), gradient: Brush? = null, isExpandedWhenFirstDisplayed: Boolean = true, parallaxMultiplier: Float = HeaderParallaxMultiplier, snapOnRelease: Boolean = false, scrollMode: ScrollMode = ScrollMode.ExitUntilCollapsed, fadeOnCollapse: Boolean = true, stretchEnabled: Boolean = false, stretchTriggerDistance: Dp = StretchTriggerDistance, animationSpec: AnimationSpec<Float> = AnimationSpec, snapThreshold: Float = SnapThreshold): ParallaxHeaderConfig
Link copied to clipboard
fun headerConfigWithAspectRatio(aspectRatio: Float = 16f / 9f, gradient: Brush? = null, isExpandedWhenFirstDisplayed: Boolean = true, maxHeight: Dp = Dp.Unspecified): ParallaxHeaderConfig
Link copied to clipboard
fun headerConfigWithPercentage(heightPercentage: Float = 0.4f, gradient: Brush? = null, isExpandedWhenFirstDisplayed: Boolean = true, maxHeight: Dp = Dp.Unspecified): ParallaxHeaderConfig
Link copied to clipboard
fun lazyColumnConfig(contentPadding: PaddingValues = PaddingValues(0.dp), verticalArrangement: Arrangement.Vertical = Arrangement.Top, horizontalAlignment: Alignment.Horizontal = Alignment.Start, flingBehavior: FlingBehavior? = null, userScrollEnabled: Boolean = true, overscrollEffect: OverscrollEffect? = null): LazyColumnConfig
Link copied to clipboard
fun semanticsConfig(expandedStateDescription: String = "Expanded", collapsedStateDescription: String = "Collapsed", expandActionLabel: String = "Expand header", collapseActionLabel: String = "Collapse header"): ParallaxSemanticsConfig
Link copied to clipboard
fun titleConfig(paddingBottom: Dp = TitlePaddingBottom, paddingStart: Dp = TitlePaddingStart, collapsedPaddingStart: Dp = TitleCollapsedPaddingStart, keepSubtitleAfterCollapse: Boolean = false, animateSubTitleHiding: Boolean = true, collapsedScale: Float = TitleCollapsedScale, collapsedAlignment: Alignment.Horizontal = Alignment.Start): ParallaxTitleConfig
Link copied to clipboard
fun toolbarConfig(initialColor: Color = Color.Transparent, targetColor: Color = Color.Black, elevation: Dp = 0.dp, animationSpec: AnimationSpec<Color> = tween(durationMillis = 300), height: Dp = ToolbarHeight, alwaysElevated: Boolean = false): ParallaxToolbarConfig