Skip to content

feat: create components - circular progress indicator and linear progress indicator#1322

Open
paulinea wants to merge 26 commits into
developfrom
1313-in-library-add-circular-progress-indicator-and-linear-progress-indicator-components
Open

feat: create components - circular progress indicator and linear progress indicator#1322
paulinea wants to merge 26 commits into
developfrom
1313-in-library-add-circular-progress-indicator-and-linear-progress-indicator-components

Conversation

@paulinea

Copy link
Copy Markdown
Member

No description provided.

@github-actions

github-actions Bot commented May 22, 2026

Copy link
Copy Markdown

@florentmaitre florentmaitre changed the title feat: create components - circular progress indicator and linear progress indicator (#1313) feat: create components - circular progress indicator and linear progress indicator May 28, 2026
import com.orange.ouds.theme.OudsThemeContract

/**
* A Circular Progress Indicator shows the progress of a task using a circle. Useful when you need more visual focus or when space is limited.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add a TODO to remind us that we need to add the design guidelines URL when available.

Same comment for OudsLinearProgressIndicator.

val progressIndicatorModifier = modifier.size(size)
val color = if (brandColor) OudsTheme.colorScheme.action.loading else OudsTheme.colorScheme.action.enabled
val strokeWidth = size * 0.125f // 25% of the radius
val strokeCap = if (OudsTheme.borders.radius.default.value > 0) StrokeCap.Round else StrokeCap.Square

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The visual aspect of the circular indicator when progress is 0.75f looks better to me when using StrokeCap.Butt instead of StrokeCap.Square. Moreover, the gap size also looks closer to the one in Figma when using StrokeCap.Butt.

With StrokeCap.Square:

Image

With StrokeCap.Butt:

Image

By the way we also used StrokeCap.Butt in OudsTag.

import com.orange.ouds.tokens.raw.OudsColorRawTokens
import com.orange.ouds.tokens.raw.OudsDimensionRawTokens

internal data class OrangeCompactProgressIndicatorTokens(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few questions about the tokens:

  • Should we wait for the official version 2.6.0 of the tokens before merging this PR?
  • There are some "mono" tokens listed in Figma, should we support a mono version of these components?
Image

Also, I found one of these mono tokens here and I don't know why:

Image

@paulinea paulinea Jun 9, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is an error. The mono tokens are for the integration in components that can be mono like the buttons. For the moment, I didn't replace the progress in all components.

Column(
modifier = modifier,
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(spacePaddingBlock.value)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the "User zoom and responsiveness" section of the Figma overview, it is written that:

Spacing between the text and the indicator must scale proportionally

So I assume we should apply the scale factor to spacePaddingBlock.

However in the Figma examples the spacing still remains the same whatever the zoom is, so I am not 100% sure about this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will ask to Anton.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We keep this implementation without the scale factor applied, Anton will fix the Figma overview.

val size = sizeCircularIndicator.value * scale

val progressIndicatorModifier = modifier.size(size)
val color = if (brandColor) OudsTheme.colorScheme.action.loading else OudsTheme.colorScheme.action.enabled

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to Figma, non-branded color is ouds/color/content/default:

Image

Same comment for OudsCircularProgressIndicator.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange but ok 😅

var track by mutableStateOf(track)

val progress: Float
get() = (progressText.toFloatOrNull() ?: 0f).coerceIn(0f, 1f)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The call to coerceIn should not be necessary because it is already done by the Material component.

ProgressIndicatorDemoBottomSheetContent(state = state)
CustomizationTextInput(
applyTopPadding = true,
label = stringResource(R.string.app_components_progressIndicator_helperText_tech),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

app_components_common_helperText_tech can be reused here.

private fun CircularProgressIndicatorDemoContent(state: ProgressIndicatorDemoState) {
Box(
modifier = Modifier.fillMaxWidth(),
contentAlignment = Alignment.Center

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I am not wrong, the Box is not necessary because there is already a Box with centered content in DemoScreen.

Same comment for LinearProgressIndicatorDemoScreen.


private fun Code.Builder.circularProgressIndicatorDemoCodeSnippet(state: ProgressIndicatorDemoState) {
with(state) {
functionCall("OudsCircularProgressIndicator") {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both code snippets can probably be factorized into a single method.

Comment thread app/src/main/res/values/strings.xml Outdated
<string name="app_components_progressIndicator_brandColor_tech" translatable="false">Brand color</string>
<string name="app_components_progressIndicator_track_tech" translatable="false">Track</string>
<string name="app_components_progressIndicator_helperText_tech" translatable="false">Helper text</string>
<string name="app_components_progressIndicator_helperTextValue_tech" translatable="false">Helper text value</string>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This key is unused and can be removed.

@paulinea paulinea force-pushed the 1313-in-library-add-circular-progress-indicator-and-linear-progress-indicator-components branch from 231e818 to f1e444c Compare June 9, 2026 14:53
@paulinea paulinea force-pushed the 1313-in-library-add-circular-progress-indicator-and-linear-progress-indicator-components branch from 31bf268 to 2b192f4 Compare June 9, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

In library, add circular progress indicator and linear progress indicator components

2 participants