-
-
Save MansuriYamin/907cb669c98b768b893d3a68d933d975 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Box(modifier = modifier) { | |
Layout( | |
measurePolicy = customSliderMeasurePolicy( | |
itemCount = itemCount, | |
gap = gap, | |
value = value, | |
startValue = valueRange.start | |
), | |
content = { | |
if (showLabel) | |
Label( | |
modifier = Modifier.layoutId(CustomSliderComponents.LABEL), | |
value = value, | |
label = label | |
) | |
Box(modifier = Modifier.layoutId(CustomSliderComponents.THUMB)) { | |
thumb(value.roundToInt()) | |
} | |
Slider( | |
modifier = Modifier | |
.fillMaxWidth() | |
.layoutId(CustomSliderComponents.SLIDER), | |
value = value, | |
valueRange = valueRange, | |
steps = steps, | |
onValueChange = { onValueChange(it) }, | |
thumb = { | |
thumb(value.roundToInt()) | |
}, | |
track = { track(it) }, | |
enabled = enabled | |
) | |
if (showIndicator) | |
Indicator( | |
modifier = Modifier.layoutId(CustomSliderComponents.INDICATOR), | |
valueRange = valueRange, | |
gap = gap, | |
indicator = indicator | |
) | |
} | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment