RangeSliderState


Class that holds information about RangeSlider's active range.

Summary

Public companion functions

Saver<RangeSliderState, *>
Saver(steps: Int, trackRange: ClosedFloatingPointRange<Float>)

The default Saver implementation for RangeSliderState.

Cmn

Public constructors

@RememberInComposition
RangeSliderState(
    startValue: Float,
    endValue: Float,
    steps: @IntRange(from = 0) Int,
    trackRange: ClosedFloatingPointRange<Float>
)
Cmn

Public properties

Float

Float that indicates the end of the selected range for the RangeSlider.

Cmn
Float

Float that indicates the start of the selected range for the RangeSlider.

Cmn
@IntRange(from = 0) Int

if positive, specifies the amount of discrete allowable values between the endpoints of trackRange.

Cmn
ClosedFloatingPointRange<Float>

the full range of values that the entire Range Slider track represents.

Cmn

Public companion functions

Saver

fun Saver(steps: Int, trackRange: ClosedFloatingPointRange<Float>): Saver<RangeSliderState, *>

The default Saver implementation for RangeSliderState.

Parameters
steps: Int

if positive, specifies the amount of discrete allowable values between the endpoints of trackRange.

trackRange: ClosedFloatingPointRange<Float>

range of values that Range Slider values can take. startValue and endValue will be coerced to this range.

Public constructors

RangeSliderState

@RememberInComposition
RangeSliderState(
    startValue: Float = 0.0f,
    endValue: Float = 1.0f,
    steps: @IntRange(from = 0) Int = 0,
    trackRange: ClosedFloatingPointRange<Float> = 0f..1f
)
Parameters
startValue: Float = 0.0f

Float that indicates the initial start value of the selected range (for the start thumb). This represents a specific position on the track and is coerced to the bounds of trackRange.

endValue: Float = 1.0f

Float that indicates the initial end value of the selected range (for the end thumb). This represents a specific position on the track and is coerced to the bounds of trackRange.

steps: @IntRange(from = 0) Int = 0

if positive, specifies the amount of discrete allowable values between the endpoints of trackRange. For example, a range from 0 to 10 with 4 steps allows 4 values evenly distributed between 0 and 10 (i.e., 2, 4, 6, 8). If steps is 0, the slider will behave continuously and allow any value from the range. Must not be negative.

trackRange: ClosedFloatingPointRange<Float> = 0f..1f

the full range of values that the entire Range Slider track represents. This defines the absolute boundaries/constraints of the slider (from minimum to maximum), and the individual thumb values (startValue and endValue) are coerced to this range.

Public properties

endValue

var endValueFloat

Float that indicates the end of the selected range for the RangeSlider.

startValue

var startValueFloat

Float that indicates the start of the selected range for the RangeSlider.

steps

val steps: @IntRange(from = 0) Int

if positive, specifies the amount of discrete allowable values between the endpoints of trackRange. For example, a range from 0 to 10 with 4 steps allows 4 values evenly distributed between 0 and 10 (i.e., 2, 4, 6, 8). If steps is 0, the slider will behave continuously and allow any value from the range. Must not be negative.

trackRange

val trackRangeClosedFloatingPointRange<Float>

the full range of values that the entire Range Slider track represents. This defines the absolute boundaries/constraints of the slider (from minimum to maximum), and the individual thumb values (startValue and endValue) are coerced to this range.