RemoteCurvedProgressIndicator

Functions summary

Unit
@RemoteComposable
@Composable
RemoteCurvedProgressIndicator(
    progress: RemoteFloat,
    modifier: RemoteModifier,
    enabled: RemoteBoolean,
    startAngle: RemoteFloat,
    sweepAngle: RemoteFloat,
    colors: RemoteProgressIndicatorColors,
    strokeWidth: RemoteDp,
    padding: RemoteDp,
    gapAngleDegrees: RemoteFloat,
    dotFadeOutFraction: RemoteFloat,
    dotCollapsible: RemoteBoolean,
    reverseDirection: RemoteBoolean
)

A generalized progress arc component for display on Wear OS.

Unit
@RemoteComposable
@Composable
RemoteCurvedProgressIndicator(
    progress: RemoteFloat,
    totalTimerDurationMillis: Long,
    modifier: RemoteModifier,
    enabled: RemoteBoolean,
    startAngle: RemoteFloat,
    sweepAngle: RemoteFloat,
    colors: RemoteProgressIndicatorColors,
    strokeWidth: RemoteDp,
    padding: RemoteDp,
    gapAngleDegrees: RemoteFloat,
    dotFadeOutFraction: RemoteFloat,
    reverseDirection: RemoteBoolean,
    countDown: RemoteBoolean
)

A specialized progress arc component for timers that includes spring physics animations at the start and end of the timer duration.

Functions

RemoteCurvedProgressIndicator

@RemoteComposable
@Composable
fun RemoteCurvedProgressIndicator(
    progress: RemoteFloat,
    modifier: RemoteModifier = RemoteModifier,
    enabled: RemoteBoolean = true.rb,
    startAngle: RemoteFloat = RemoteProgressIndicatorDefaults.CurvedIndicatorStartAngle,
    sweepAngle: RemoteFloat = RemoteProgressIndicatorDefaults.CurvedIndicatorSweepAngle,
    colors: RemoteProgressIndicatorColors = RemoteProgressIndicatorDefaults.colors(),
    strokeWidth: RemoteDp = RemoteProgressIndicatorDefaults.CurvedIndicatorStrokeWidth,
    padding: RemoteDp = RemoteProgressIndicatorDefaults.CurvedIndicatorPadding,
    gapAngleDegrees: RemoteFloat = RemoteProgressIndicatorDefaults.CurvedIndicatorGapAngleDegrees,
    dotFadeOutFraction: RemoteFloat = RemoteProgressIndicatorDefaults.CurvedIndicatorDotFadeOutFraction,
    dotCollapsible: RemoteBoolean = true.rb,
    reverseDirection: RemoteBoolean = false.rb
): Unit

A generalized progress arc component for display on Wear OS.

import androidx.compose.remote.creation.compose.state.rf
import androidx.wear.compose.remote.material3.RemoteCurvedProgressIndicator

RemoteCurvedProgressIndicator(
    progress = 0.75f.rf,
    modifier = modifier,
    startAngle = 135f.rf,
    sweepAngle = 90f.rf,
)
For an animated progress, see:
import androidx.compose.remote.creation.compose.action.valueChange
import androidx.compose.remote.creation.compose.modifier.clickable
import androidx.compose.remote.creation.compose.state.animateRemoteFloatAsState
import androidx.compose.remote.creation.compose.state.rememberMutableRemoteFloat
import androidx.compose.remote.creation.compose.state.remoteTween
import androidx.compose.remote.creation.compose.state.rf
import androidx.wear.compose.remote.material3.RemoteCurvedProgressIndicator

val progress = rememberMutableRemoteFloat { 0.25f.rf }
val animatedProgress =
    animateRemoteFloatAsState(
        targetValue = progress,
        animationSpec = remoteTween(durationMillis = 250),
    )
val toggleAction = valueChange(progress, ((progress + 0.25f) % 1f).createReference())

RemoteCurvedProgressIndicator(
    progress = animatedProgress,
    modifier = modifier.clickable(toggleAction),
    startAngle = 135f.rf,
    sweepAngle = 90f.rf,
)
Parameters
progress: RemoteFloat

A float value representing progress (typically 0f to 1f).

modifier: RemoteModifier = RemoteModifier

Modifier to be applied to the canvas.

enabled: RemoteBoolean = true.rb

controls the enabled state. When enabled is false, this component will appear visually disabled.

startAngle: RemoteFloat = RemoteProgressIndicatorDefaults.CurvedIndicatorStartAngle

The starting position of the progress arc in degrees. For example, 135 is bottom left.

sweepAngle: RemoteFloat = RemoteProgressIndicatorDefaults.CurvedIndicatorSweepAngle

The total sweep angle of the progress arc in degrees. For example, 90 degrees.

colors: RemoteProgressIndicatorColors = RemoteProgressIndicatorDefaults.colors()

RemoteProgressIndicatorColors that will be used to resolve the indicator and track color.

strokeWidth: RemoteDp = RemoteProgressIndicatorDefaults.CurvedIndicatorStrokeWidth

Width of the arc in dp.

padding: RemoteDp = RemoteProgressIndicatorDefaults.CurvedIndicatorPadding

Padding from the canvas/screen edge in dp.

gapAngleDegrees: RemoteFloat = RemoteProgressIndicatorDefaults.CurvedIndicatorGapAngleDegrees

Size of the visual separation gap between segments in degrees. Set to 0f for continuous bars.

dotFadeOutFraction: RemoteFloat = RemoteProgressIndicatorDefaults.CurvedIndicatorDotFadeOutFraction

The fraction of the dot's size (from 0.0 to 1.0) below which the dot fades its opacity to transparent as it collapses/expands. Set to 0.0 to disable opacity fading and shrink purely through size.

dotCollapsible: RemoteBoolean = true.rb

Whether the indicator's dot should collapse as it approaches the end of the track.

reverseDirection: RemoteBoolean = false.rb

Whether to reverse the direction of the progress indicator (RTL).

RemoteCurvedProgressIndicator

@RemoteComposable
@Composable
fun RemoteCurvedProgressIndicator(
    progress: RemoteFloat,
    totalTimerDurationMillis: Long,
    modifier: RemoteModifier = RemoteModifier,
    enabled: RemoteBoolean = true.rb,
    startAngle: RemoteFloat = RemoteProgressIndicatorDefaults.CurvedIndicatorStartAngle,
    sweepAngle: RemoteFloat = RemoteProgressIndicatorDefaults.CurvedIndicatorSweepAngle,
    colors: RemoteProgressIndicatorColors = RemoteProgressIndicatorDefaults.colors(),
    strokeWidth: RemoteDp = RemoteProgressIndicatorDefaults.CurvedIndicatorStrokeWidth,
    padding: RemoteDp = RemoteProgressIndicatorDefaults.CurvedIndicatorPadding,
    gapAngleDegrees: RemoteFloat = RemoteProgressIndicatorDefaults.CurvedIndicatorGapAngleDegrees,
    dotFadeOutFraction: RemoteFloat = RemoteProgressIndicatorDefaults.CurvedIndicatorDotFadeOutFraction,
    reverseDirection: RemoteBoolean = false.rb,
    countDown: RemoteBoolean = false.rb
): Unit

A specialized progress arc component for timers that includes spring physics animations at the start and end of the timer duration.

Parameters
progress: RemoteFloat

A float value representing progress (typically 0f to 1f).

totalTimerDurationMillis: Long

Total duration of the timer in milliseconds. Needed because fixed-duration intro and outro animations run for a constant amount of time regardless of timer length, requiring the component to calculate progress elapsed during these transitions.

modifier: RemoteModifier = RemoteModifier

Modifier to be applied to the canvas.

enabled: RemoteBoolean = true.rb

controls the enabled state. When enabled is false, this component will appear visually disabled.

startAngle: RemoteFloat = RemoteProgressIndicatorDefaults.CurvedIndicatorStartAngle

The starting position of the progress arc in degrees. For example, 135 is bottom left.

sweepAngle: RemoteFloat = RemoteProgressIndicatorDefaults.CurvedIndicatorSweepAngle

The total sweep angle of the progress arc in degrees. For example, 90 degrees.

colors: RemoteProgressIndicatorColors = RemoteProgressIndicatorDefaults.colors()

RemoteProgressIndicatorColors that will be used to resolve the indicator and track color.

strokeWidth: RemoteDp = RemoteProgressIndicatorDefaults.CurvedIndicatorStrokeWidth

Width of the arc in dp.

padding: RemoteDp = RemoteProgressIndicatorDefaults.CurvedIndicatorPadding

Padding from the canvas/screen edge in dp.

gapAngleDegrees: RemoteFloat = RemoteProgressIndicatorDefaults.CurvedIndicatorGapAngleDegrees

Size of the visual separation gap between segments in degrees. Set to 0f for continuous bars.

dotFadeOutFraction: RemoteFloat = RemoteProgressIndicatorDefaults.CurvedIndicatorDotFadeOutFraction

The fraction of the dot's size (from 0.0 to 1.0) below which the dot fades its opacity to transparent as it collapses/expands. Set to 0.0 to disable opacity fading and shrink purely through size.

reverseDirection: RemoteBoolean = false.rb

Whether to reverse the direction of the progress indicator (RTL).

countDown: RemoteBoolean = false.rb

Whether this is a countdown timer (i.e., progress goes from top to bottom). If true, the intro animation plays when progress is near 1.0, and the outro animation plays when progress approaches 0.0. If false, the other way around will be done.