RemoteCircularProgressIndicator

Functions summary

Unit
@RemoteComposable
@Composable
RemoteCircularProgressIndicator(
    modifier: RemoteModifier,
    colors: RemoteProgressIndicatorColors,
    strokeWidth: RemoteDp,
    gapSize: RemoteDp
)

Indeterminate Material Design circular progress indicator.

Unit
@RemoteComposable
@Composable
RemoteCircularProgressIndicator(
    progress: RemoteFloat,
    modifier: RemoteModifier,
    enabled: RemoteBoolean,
    startAngle: RemoteFloat,
    endAngle: RemoteFloat,
    colors: RemoteProgressIndicatorColors,
    strokeWidth: RemoteDp,
    gapSize: RemoteDp
)

Material Design circular progress indicator.

Functions

RemoteCircularProgressIndicator

@RemoteComposable
@Composable
fun RemoteCircularProgressIndicator(
    modifier: RemoteModifier = RemoteModifier,
    colors: RemoteProgressIndicatorColors = RemoteProgressIndicatorDefaults.colors(),
    strokeWidth: RemoteDp = RemoteProgressIndicatorDefaults.IndeterminateStrokeWidth,
    gapSize: RemoteDp = RemoteProgressIndicatorDefaults.calculateRecommendedGapSize(strokeWidth)
): Unit

Indeterminate Material Design circular progress indicator.

Indeterminate progress indicator expresses an unspecified wait time and spins indefinitely.

Example of indeterminate circular progress indicator:

import androidx.wear.compose.remote.material3.RemoteCircularProgressIndicator

RemoteCircularProgressIndicator(modifier = modifier)
Parameters
modifier: RemoteModifier = RemoteModifier

Modifier to be applied to the RemoteCircularProgressIndicator.

colors: RemoteProgressIndicatorColors = RemoteProgressIndicatorDefaults.colors()

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

strokeWidth: RemoteDp = RemoteProgressIndicatorDefaults.IndeterminateStrokeWidth

The stroke width for the progress indicator. Defaults to RemoteProgressIndicatorDefaults.IndeterminateStrokeWidth. Negative values are coerced to 0; nothing is drawn when strokeWidth is 0 or negative.

gapSize: RemoteDp = RemoteProgressIndicatorDefaults.calculateRecommendedGapSize(strokeWidth)

The size (in RemoteDp) of the gap between the ends of the progress indicator and the track.

RemoteCircularProgressIndicator

@RemoteComposable
@Composable
fun RemoteCircularProgressIndicator(
    progress: RemoteFloat,
    modifier: RemoteModifier = RemoteModifier,
    enabled: RemoteBoolean = true.rb,
    startAngle: RemoteFloat = RemoteProgressIndicatorDefaults.StartAngle,
    endAngle: RemoteFloat = startAngle,
    colors: RemoteProgressIndicatorColors = RemoteProgressIndicatorDefaults.colors(),
    strokeWidth: RemoteDp = RemoteProgressIndicatorDefaults.DefaultStrokeWidth,
    gapSize: RemoteDp = RemoteProgressIndicatorDefaults.calculateRecommendedGapSize(strokeWidth)
): Unit

Material Design circular progress indicator.

The progress arc is always drawn clockwise from startAngle to endAngle. When endAngle equals startAngle (the default), a full 360-degree circle is drawn; when endAngle is less than startAngle, the arc wraps clockwise past 0 degrees (3 o'clock).

Animates changes to progress with the RemoteMotionScheme.slowEffectsSpec of RemoteMaterialTheme.motionScheme.

Example of a RemoteCircularProgressIndicator showing static progress:

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

RemoteCircularProgressIndicator(modifier = modifier, progress = 0.75f.rf)

Example that changes progress on click:

import androidx.compose.remote.creation.compose.action.valueChangeAction
import androidx.compose.remote.creation.compose.modifier.clickable
import androidx.compose.remote.creation.compose.state.MutableRemoteFloat
import androidx.compose.remote.creation.compose.state.rf
import androidx.compose.runtime.remember
import androidx.wear.compose.remote.material3.RemoteCircularProgressIndicator

val progress = remember { MutableRemoteFloat(0.25f) }
val toggleAction = valueChangeAction(progress, (progress + 0.25f.rf) % 1f.rf)

// The indicator animates the progress changes.
RemoteCircularProgressIndicator(progress = progress, modifier.clickable(toggleAction))
Parameters
progress: RemoteFloat

The progress of this progress indicator where 0.0 represents no progress and 1.0 represents completion. Values outside of this range are coerced into the range 0..1. Progress changes are animated.

modifier: RemoteModifier = RemoteModifier

Modifier to be applied to the RemoteCircularProgressIndicator.

enabled: RemoteBoolean = true.rb

controls the enabled state. When enabled is false, this component will appear visually disabled. Note that only solid colors are supported when enabled is an expression, otherwise it must be a constant.

startAngle: RemoteFloat = RemoteProgressIndicatorDefaults.StartAngle

The starting position of the progress arc, measured clockwise in degrees from the 3 o'clock position. Defaults to RemoteProgressIndicatorDefaults.StartAngle (12 o'clock).

endAngle: RemoteFloat = startAngle

The ending position of the progress arc, measured clockwise in degrees from the 3 o'clock position. Defaults to startAngle (a full 360-degree circle). The arc is always drawn clockwise from startAngle to endAngle, wrapping past 0 degrees if endAngle is less than startAngle.

colors: RemoteProgressIndicatorColors = RemoteProgressIndicatorDefaults.colors()

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

strokeWidth: RemoteDp = RemoteProgressIndicatorDefaults.DefaultStrokeWidth

The stroke width for the progress indicator. Defaults to RemoteProgressIndicatorDefaults.DefaultStrokeWidth. Negative values are coerced to 0; nothing is drawn when strokeWidth is 0 or negative.

gapSize: RemoteDp = RemoteProgressIndicatorDefaults.calculateRecommendedGapSize(strokeWidth)

The size (in RemoteDp) of the gap between the ends of the progress indicator and the track. The stroke endcaps are not included in this distance.