Build apps faster with over 150+ styled components and screens! Check it out →

ArcProgressIndicator

Android

Component in Wear Material 3 Compose

Indeterminate Material Design arc progress indicator.

Indeterminate progress indicator expresses an unspecified wait time and animates indefinitely. This overload provides a variation over the usual circular spinner by allowing the start and end angles to be specified.

Last updated:

Installation

dependencies {
   implementation("androidx.wear.compose:compose-material3:1.0.0-alpha32")
}

Overloads

@Composable
fun ArcProgressIndicator(
    modifier: Modifier = Modifier,
    startAngle: Float = ArcProgressIndicatorDefaults.IndeterminateStartAngle,
    endAngle: Float = ArcProgressIndicatorDefaults.IndeterminateEndAngle,
    angularDirection: AngularDirection = AngularDirection.CounterClockwise,
    colors: ProgressIndicatorColors = ProgressIndicatorDefaults.colors(),
    strokeWidth: Dp = ArcProgressIndicatorDefaults.IndeterminateStrokeWidth,
    gapSize: Dp = ArcProgressIndicatorDefaults.calculateRecommendedGapSize(strokeWidth),
)

Parameters

namedescription
modifierModifier to be applied to the ArcProgressIndicator.
startAnglethe start angle of this progress indicator arc (specified in degrees). It is recommended to use [ArcProgressIndicatorDefaults.IndeterminateStartAngle]. Measured clockwise from the three o'clock position.
endAnglethe end angle of this progress indicator arc (specified in degrees). It is recommended to use [ArcProgressIndicatorDefaults.IndeterminateEndAngle]. Measured clockwise from the three o'clock position.
angularDirectionDetermines whether the animation is in the clockwise or counter-clockwise direction.
colors[ProgressIndicatorColors] that will be used to resolve the indicator and track color for this progress indicator.
strokeWidthThe stroke width for the progress indicator. The recommended value is [ArcProgressIndicatorDefaults.IndeterminateStrokeWidth].
gapSizeThe size (in Dp) of the gap between the ends of the progress indicator and the track. The stroke end caps are not included in this distance.

Code Example

IndeterminateProgressArcSample

@Composable
fun IndeterminateProgressArcSample() {
    Box(modifier = Modifier.fillMaxSize()) {
        ArcProgressIndicator(
            modifier =
                Modifier.align(Alignment.Center)
                    .size(ArcProgressIndicatorDefaults.recommendedIndeterminateDiameter),
        )
    }
}
by @alexstyl