setValue

open fun setValue(value: Float)

Sets the value of the slider.

The thumb value must be greater or equal to valueFrom, and lesser or equal to valueTo. If that is not the case, an IllegalStateException will be thrown when the view is laid out.

If the slider is in discrete mode (i.e. the tick increment value is greater than 0), the thumb's value must be set to a value falls on a tick (i.e.: value == valueFrom + x * stepSize, where x is an integer equal to or greater than 0). If that is not the case, an IllegalStateException will be thrown when the view is laid out.

Parameters

value

The value to which to set the slider

See also