Function

styleLocalOf

Creates a new local style property.

styleLocalOf

Source set: Common
public fun <T> styleLocalOf(
    name: String,
    interpolate: (a: T, b: T, t: Float) -> T = ::defaultInterpolate,
    defaultValue: () -> T,
): ProvidableStyleProperty<T>

Creates a new local style property.

Local style properties inherit their values down the layout tree hierarchy.

Defining a local style property using styleLocalOf produces a style property that will use a jump-cut halfway through the animation (except if the type implements Interpolatable as described below). Use the interpolate instead in order to specify the interpolation function to use for an animatable property.

If the type supports Interpolatable, such as Brush, styleLocalOf will use the Interpolatable implementation instead of a jump-cut.

Parameters

name debug/tooling name for the property
interpolate interpolate the values a and b on t which is a fraction between 0f and 1f
defaultValue fallback value provider when the property is not provided

Content updated: