File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
slider/src/main/java/io/monstarlab/mosaic/slider Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 1
1
package io.monstarlab.mosaic.slider
2
2
3
+ import androidx.annotation.FloatRange
3
4
import kotlin.math.sqrt
4
5
5
6
/* *
@@ -12,18 +13,18 @@ public interface SliderValueDistribution {
12
13
13
14
/* *
14
15
* Interpolates a value based on the distribution strategy.
15
- * @param value the input value to interpolate
16
- * @return the interpolated value based on the distribution strategy
16
+ * @param value the normalized input value to interpolate, it must be between 0 and 1
17
+ * @return the normalized interpolated value based on the distribution strategy, between 0 and 1
17
18
*/
18
- public fun interpolate (value : Float ): Float
19
+ public fun interpolate (@FloatRange( 0.0 , 1.0 ) value : Float ): Float
19
20
20
21
/* *
21
22
* Inversely interpolates a value from the output range to the input range based on the distribution strategy.
22
23
*
23
- * @param value the output value to inverse interpolate
24
- * @return the inverse interpolated value based on the distribution strategy
24
+ * @param value the normalized value to inverse interpolate, must be between 0 and 1
25
+ * @return the normalized inverse interpolated value based on the distribution strategy, between 0 and 1
25
26
*/
26
- public fun inverse (value : Float ): Float
27
+ public fun inverse (@FloatRange( 0.0 , 1.0 ) value : Float ): Float
27
28
28
29
public companion object {
29
30
You can’t perform that action at this time.
0 commit comments