@@ -38,25 +38,25 @@ Most likely you would also want to provide your custom range for the slider
38
38
39
39
var sliderValue by remember { mutableFloatStateOf(50f ) }
40
40
41
- Slider (
41
+ MosaciSlider (
42
42
value = sliderValue,
43
43
onValueChange = { newValue -> sliderValue = newValue },
44
- colors = SliderColors (Color .Green ),
44
+ colors = MosaicSliderColors (Color .Green ),
45
45
range = 0f .. 100f
46
46
)
47
47
```
48
48
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
50
50
51
51
``` kotlin
52
- val slideState = rememberSliderState (
52
+ val slideState = rememberMosaicSliderState (
53
53
initialValue = 50f ,
54
54
range = 0f .. 100f
55
55
)
56
56
57
- Slider (
57
+ MosaicSlider (
58
58
state = slideState,
59
- colors = SliderColors (Color .Green )
59
+ colors = MosaicSliderColors (Color .Green )
60
60
)
61
61
```
62
62
@@ -69,9 +69,9 @@ By default, Mosaic Slider has its own Slider Thumb which resembles the thumb you
69
69
Following example has a custom thumb that displays current value and animates its size based on wether user drags it or not
70
70
71
71
``` kotlin
72
- Slider (
72
+ MosaicSlider (
73
73
state = slideState,
74
- colors = SliderColors (Color .Green ),
74
+ colors = MosaicSliderColors (Color .Green ),
75
75
thumb = { state ->
76
76
val size = animateDpAsState(
77
77
targetValue = if (state.isDragging) {
@@ -167,7 +167,7 @@ Using `CheckpointValuesDistribution` we can place values between 0 and 200 at th
167
167
``` kotlin
168
168
val distribution = SliderValuesDistribution .checkpoints(
169
169
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
171
171
1f to 1000f // end of the slider
172
172
)
173
173
```
@@ -181,7 +181,7 @@ object MyDistribution: SliderValueDistribution {
181
181
override fun inverse (value : Float ): Float {
182
182
// inverse value
183
183
}
184
- s
184
+
185
185
override fun interpolate (value : Float ): Float {
186
186
// interpolate value
187
187
}
0 commit comments