I would like to customize the Slider discrete component .
I tried something like :
Slider(
value = defaultLevel.toFloat(),
onValueChange = onValueChange,
valueRange = 0..10,
modifier = Modifier.size(300.dp, 80.dp),
steps = 4,
enabled = true,
colors = colors,
thumb = {
SliderDefaults.Thumb(
interactionSource = interactionSource,
colors = colors,
modifier = Modifier
.size(width = 10.dp, height = 50.dp)
.indication(
interactionSource = interactionSource,
indication = rememberRipple(
bounded = false,
radius = 20.dp
)
)
.hoverable(interactionSource = interactionSource)
.background(defaultColor, RectangleShape)
)
}
)
But the result is not the one expected. The "UI" is good, but the thumb is not centered with the tick. I can see two boxes actually in the "inspector tool". My new thumb and another one which is larger and seems to be the "default one" with the circle.
How is it possible to "center" my custom thumb or at least, to specify the position to be align with the tick ?
Another ask, how to handle the tick ? I can't find a way to customize it.