Slider

@Composable
fun Slider(value: Float, onValueChangeFinished: (Float) -> Unit, modifier: Modifier = Modifier, onValueChange: (Float) -> Unit? = null, enabled: Boolean = true, trackHeight: Dp = Theme.size.box3, trackColor: Color = Theme.color.backgroundVariant, activeColor: Color = Theme.color.primaryContainer, trackShape: Shape = Theme.shape.v7, showThumb: Boolean = true, thumbColor: Color = Theme.color.onContainer, content: @Composable BoxScope.() -> Unit? = null)

Parameters

value

当前进度 (0 ~ 1)

onValueChangeFinished

拖拽结束事件

onValueChange

拖拽事件 (进度变化频繁)

enabled

启用

trackHeight

轨高

trackColor

背景色

activeColor

激活色

trackShape

轨形状

showThumb

是否显示拖纽

thumbColor

拖钮颜色

content

其他叠加内容


@Composable
fun <T> Slider(value: T, converter: SliderConverter<T>, onValueChangeFinished: (T) -> Unit, modifier: Modifier = Modifier, onValueChange: (T) -> Unit? = null, enabled: Boolean = true, trackHeight: Dp = Theme.size.box3, trackColor: Color = Theme.color.backgroundVariant, activeColor: Color = Theme.color.primaryContainer, trackShape: Shape = Theme.shape.v7, showThumb: Boolean = true, thumbColor: Color = Theme.color.onContainer, content: @Composable BoxScope.() -> Unit? = null)