Skip to content

Commit ae78388

Browse files
committed
docs: update Slider doc
1 parent a78471f commit ae78388

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

docs/slider.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,25 @@ Most likely you would also want to provide your custom range for the slider
3838

3939
var sliderValue by remember { mutableFloatStateOf(50f) }
4040

41-
Slider(
41+
MosaciSlider(
4242
value = sliderValue,
4343
onValueChange = { newValue -> sliderValue = newValue },
44-
colors = SliderColors(Color.Green),
44+
colors = MosaicSliderColors(Color.Green),
4545
range = 0f..100f
4646
)
4747
```
4848

49-
Alternatively there is an option to declare the slider using `rememberSliderState` function
49+
Alternatively there is an option to declare the slider using `rememberMosaicSliderState` function
5050

5151
```kotlin
52-
val slideState = rememberSliderState(
52+
val slideState = rememberMosaicSliderState(
5353
initialValue = 50f,
5454
range = 0f..100f
5555
)
5656

57-
Slider(
57+
MosaicSlider(
5858
state = slideState,
59-
colors = SliderColors(Color.Green)
59+
colors = MosaicSliderColors(Color.Green)
6060
)
6161
```
6262

@@ -69,9 +69,9 @@ By default, Mosaic Slider has its own Slider Thumb which resembles the thumb you
6969
Following example has a custom thumb that displays current value and animates its size based on wether user drags it or not
7070

7171
```kotlin
72-
Slider(
72+
MosaicSlider(
7373
state = slideState,
74-
colors = SliderColors(Color.Green),
74+
colors = MosaicSliderColors(Color.Green),
7575
thumb = { state ->
7676
val size = animateDpAsState(
7777
targetValue = if (state.isDragging) {
@@ -167,7 +167,7 @@ Using `CheckpointValuesDistribution` we can place values between 0 and 200 at th
167167
```kotlin
168168
val distribution = SliderValuesDistribution.checkpoints(
169169
0f to 0f, // beginging of the slider
170-
0.5f to 200f // half of the slider is now 200
170+
0.5f to 200f, // half of the slider is now 200
171171
1f to 1000f // end of the slider
172172
)
173173
```
@@ -181,7 +181,7 @@ object MyDistribution: SliderValueDistribution {
181181
override fun inverse(value: Float): Float {
182182
// inverse value
183183
}
184-
s
184+
185185
override fun interpolate(value: Float): Float {
186186
// interpolate value
187187
}

0 commit comments

Comments
 (0)