ProgressSlider

Functions summary

Unit

A Material3 Slider that displays the current position of the player.

Unit
@ExperimentalApi
@Composable
ProgressSlider(
    player: Player?,
    modifier: Modifier,
    onValueChange: ((Float) -> Unit)?,
    onValueChangeFinished: (() -> Unit)?,
    scope: CoroutineScope,
    colors: SliderColors,
    interactionSource: MutableInteractionSource
)

A Material3 Slider that displays the current position of the player.

Functions

@UnstableApi
@Composable
fun ProgressSlider(player: Player?, modifier: Modifier = Modifier): Unit

A Material3 Slider that displays the current position of the player.

Parameters
player: Player?

The Player to get the progress from.

modifier: Modifier = Modifier

The Modifier to be applied to the slider.

@ExperimentalApi
@Composable
fun ProgressSlider(
    player: Player?,
    modifier: Modifier = Modifier,
    onValueChange: ((Float) -> Unit)? = null,
    onValueChangeFinished: (() -> Unit)? = null,
    scope: CoroutineScope = rememberCoroutineScope(),
    colors: SliderColors = SliderDefaults.colors(),
    interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }
): Unit

A Material3 Slider that displays the current position of the player.

Parameters
player: Player?

The Player to get the progress from.

modifier: Modifier = Modifier

The Modifier to be applied to the slider.

onValueChange: ((Float) -> Unit)? = null

An optional callback that is invoked continuously as the user drags the slider thumb. The lambda receives a Float representing the new progress value (from 0.0 to 1.0). This can be used to display a preview of the seek position. You should not use this callback to update the slider's value, as this is handled internally.

onValueChangeFinished: (() -> Unit)? = null

An optional callback that is invoked when the user has finished their interaction (by lifting their finger or tapping). The underlying Player.seekTo operation is performed internally just before this callback is invoked.

scope: CoroutineScope = rememberCoroutineScope()

The CoroutineScope to use for listening to player progress updates.

colors: SliderColors = SliderDefaults.colors()

SliderColors that will be used to resolve the colors used for this slider in different states. See SliderDefaults.colors.

interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }

the MutableInteractionSource representing the stream of Interactions for this slider. You can create and pass in your own remembered instance to observe Interactions and customize the appearance / behavior of this slider in different states.