The second Android 11 Developer Preview is now available, test it out and share your feedback.

SliderPosition

class SliderPosition
kotlin.Any
   ↳ androidx.ui.material.SliderPosition

State for Slider that represents the Slider value, its bounds and optional amount of steps evenly distributed across the Slider range.

Summary

Public constructors

<init>(initial: Float = 0f, valueRange: ClosedFloatingPointRange<Float> = 0f..1f, steps: Int = 0, animatedClock: AnimationClockObservable)

State for Slider that represents the Slider value, its bounds and optional amount of steps evenly distributed across the Slider range.

Properties

Float

Current Slider value.

ClosedFloatingPointRange<Float>

range of values that Slider value can take

Public constructors

<init>

SliderPosition(
    initial: Float = 0f,
    valueRange: ClosedFloatingPointRange<Float> = 0f..1f,
    steps: Int = 0,
    animatedClock: AnimationClockObservable)

State for Slider that represents the Slider value, its bounds and optional amount of steps evenly distributed across the Slider range.

Parameters
initial: Float = 0f initial value for the Slider when created. If outside of range provided, initial position will be coerced to this range
valueRange: ClosedFloatingPointRange<Float> = 0f..1f range of values that Slider value can take
steps: Int = 0 if greater than 0, specifies the amounts of discrete values, evenly distributed between across the whole value range. If 0, slider will behave as a continuous slider and allow to choose any value from the range specified

Properties

value

var value: Float

Current Slider value. If set outside of range provided, value will be coerced to this range

valueRange

val valueRange: ClosedFloatingPointRange<Float>

range of values that Slider value can take