0

im trying to make my circular proggresion rounded as it should be https://developer.android.com/reference/kotlin/androidx/compose/material3/package-summary#CircularProgressIndicator(androidx.compose.ui.Modifier,androidx.compose.ui.graphics.Color,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.StrokeCap) in official docs, but when i try to use it in my project i dont have the stroke parameter and instead it is hardcoded as

@Composable
fun CircularProgressIndicator(
    modifier: Modifier = Modifier,
    color: Color = ProgressIndicatorDefaults.circularColor,
    strokeWidth: Dp = ProgressIndicatorDefaults.CircularStrokeWidth
) {
    val stroke = with(LocalDensity.current) {
        Stroke(width = strokeWidth.toPx(), cap = StrokeCap.Square)
    }.

... anyone had similar problem?

  • try to import androidx.compose.ui.graphics.drawscope.Stroke and import androidx.compose.ui.graphics.StrokeCap. Make sure that you are importing CircularProgressIndicator from material3 – Vishnu S Dharan May 30 '23 at 10:14
  • im importing it from androidx.compose.material3.CircularProgressIndicator – Jozef Forgáč May 30 '23 at 10:22
  • with import androidx.compose.ui.graphics.drawscope.Stroke and import androidx.compose.ui.graphics.StrokeCap I am getting StrokeCap. – Vishnu S Dharan May 30 '23 at 10:26
  • when i use the imports i still have two options, one is with parameters modifier,color,strokewidth and other has progress too.... weird – Jozef Forgáč May 30 '23 at 10:30
  • okay i found out that i had 1.0.0 version of md3 where circular indicator had less paramaters and now using 1.1.0 works :) thanks for help friend @VishnuSDharan – Jozef Forgáč May 30 '23 at 10:43

0 Answers0