Travis Griggs
09/26/2023, 6:43 PMConstraintLayout(modifier = Modifier.fillMaxWidth().height(50.dp)) {
var thumbRef = createRef()
Text(text = recursLabel, modifier = Modifier.constrainAs(createRef()) {
centerHorizontallyTo(thumbRef)
bottom.linkTo(<http://thumbRef.top|thumbRef.top>, margin = 20.dp)
})
var interactionSource = remember { MutableInteractionSource() }
Slider(
value = recursPosition,
onValueChange = { update -> recursPosition = update },
interactionSource = interactionSource,
steps = 6,
onValueChangeFinished = { cue.recurs = recursValue },
valueRange = 0f..7f,
thumb = { state ->
SliderDefaults.Thumb(interactionSource = interactionSource,
modifier = Modifier.constrainAs(thumbRef) {}
)
}
)
}
Is there a gotcha I missed above that is preventing this from working? Or am I just fundamentally barking up the wrong tree? (I had begun to do this with BoxWithConstraints and managing the offset, but that has its own issues/difficulties)