zt
11/15/2026, 3:10 AMhue changes
.progressSemantics(
value = hue(),
valueRange = 0f..360f,
steps = 360
)
This doesn’t and skips as expected
.semantics {
progressBarRangeInfo = ProgressBarRangeInfo(
current = hue(),
range = 0f..360f,
steps = 360
)
}
Looking at the source code of progressSemantics it’s almost exactly the same
@Stable
fun Modifier.progressSemantics(
value: Float,
valueRange: ClosedFloatingPointRange<Float> = 0f..1f,
@IntRange(from = 0) steps: Int = 0,
): Modifier {
// Older versions of Talkback will ignore nodes with range info which aren't focusable or
// screen reader focusable. Setting this semantics as merging descendants will mark it as
// screen reader focusable.
return semantics(mergeDescendants = true) {
progressBarRangeInfo = ProgressBarRangeInfo(value.coerceIn(valueRange), valueRange, steps)
}
}Ian Lake
11/16/2026, 1:31 AMsemantics block, and one is only reading it in the semantics block (which only updates the separate accessibility tree).Ian Lake
11/16/2026, 1:34 AMprogressSemantics overload that takes a lambda for the value, similar to how `Modifier.offset` does so that the value read is only done in the semantic scope. That seems like it would be a clear performance winIan Lake
11/16/2026, 1:35 AMzt
11/16/2026, 4:39 AM