Skip to content

Commit

Permalink
Fix crash when progress bar has zero range (#1828)
Browse files Browse the repository at this point in the history
Regression after
#1719
  • Loading branch information
ASalavei authored Feb 10, 2025
1 parent f2e66ca commit edf7322
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ internal fun SemanticsConfiguration.accessibilityValue(): String? {
}

return getOrNull(SemanticsProperties.ProgressBarRangeInfo)?.let {
return if (!it.range.isEmpty()) {
return if (it.range.endInclusive > it.range.start) {
val fraction = (it.current - it.range.start) /
(it.range.endInclusive - it.range.start)
"${(fraction * 100f).roundToInt()}%"
Expand Down

0 comments on commit edf7322

Please sign in to comment.