We just launched Compose Examples featuring over 150+ components! Check it out →

rangeSemantics

Android

Modifier in Wear Material 3 Compose

Modifier to add semantics signifying progress of the Stepper/Slider.

Last updated:

Installation

dependencies {
   implementation("androidx.wear.compose:compose-material3:1.0.0-alpha27")
}

Overloads


fun Modifier.rangeSemantics(
    value: Float,
    enabled: Boolean,
    onValueChange: (Float) -> Unit,
    valueRange: ClosedFloatingPointRange<Float>,
    steps: Int
): Modifier

Parameters

namedescription
valueCurrent value of the ProgressIndicator/Slider. If outside of [valueRange] provided, value will be coerced to this range. Must not be NaN.
enabledIf false then semantics will not be added.
onValueChangeLambda which updates [value].
valueRangeRange of values that value can take. Passed [value] will be coerced to this range.
stepsIf greater than 0, specifies the amounts of discrete values, evenly distributed between across the whole value range. If 0, any value from the range specified is allowed. Must not be negative.
by @alexstyl