commit | 2f46c05de6ddcacafb618561f36f1052797e2da1 | [log] [tgz] |
---|---|---|
author | Paul Thomas <pfthomas@google.com> | Wed May 22 21:21:56 2024 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Wed May 22 21:21:56 2024 +0000 |
tree | 9caa7ab1cffe366a5188944e8816f8e9c00c08b1 | |
parent | f4b360f1278aef986aaa3fa4fbd718baa2f14011 [diff] | |
parent | 99bb2aaac447079358a8101896712d6a372f5c0a [diff] |
Merge "[CircularProgressIndicator] Fix gapSize not scaling with diameter" into androidx-main
diff --git a/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ProgressIndicatorScreenshotTest.kt b/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ProgressIndicatorScreenshotTest.kt index 6a6af69..9bb7c63 100644 --- a/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ProgressIndicatorScreenshotTest.kt +++ b/compose/material3/material3/src/androidInstrumentedTest/kotlin/androidx/compose/material3/ProgressIndicatorScreenshotTest.kt
@@ -182,6 +182,19 @@ } @Test + fun circularProgressIndicator_lightTheme_determinate_size() { + rule.setMaterialContent(lightColorScheme()) { + Box(wrap.testTag(wrapperTestTag)) { + CircularProgressIndicator( + modifier = Modifier.size(88.dp), + progress = { 0.5f } + ) + } + } + assertIndicatorAgainstGolden("circularProgressIndicator_lightTheme_determinate_size") + } + + @Test fun circularProgressIndicator_lightTheme_indeterminate() { rule.mainClock.autoAdvance = false rule.setMaterialContent(lightColorScheme()) {
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/ProgressIndicator.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/ProgressIndicator.kt index 9381e45..d193764 100644 --- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/ProgressIndicator.kt +++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/ProgressIndicator.kt
@@ -581,7 +581,7 @@ gapSize + strokeWidth } val gapSizeSweep = - (adjustedGapSize.value / (Math.PI * CircularIndicatorDiameter.value).toFloat()) * 360f + (adjustedGapSize.value / (Math.PI * size.width.toDp().value).toFloat()) * 360f drawCircularIndicator( startAngle + sweep + min(sweep, gapSizeSweep),