Rename progress variable to percentage

This commit is contained in:
Florian Renaud 2023-08-18 10:17:48 +02:00
parent df1be4f6b1
commit d59349184f
4 changed files with 10 additions and 10 deletions

View file

@ -41,7 +41,7 @@ class TimelineItemContentPollFactory @Inject constructor(
val answerItems = content.answers.map { answer ->
val votesCount = content.votes[answer.id]?.size ?: 0
val isSelected = answer.id in userVotes
val progress = when {
val percentage = when {
pollVotesCount == 0 -> 0f
content.kind.isDisclosed -> votesCount.toFloat() / pollVotesCount.toFloat()
isSelected -> 1f
@ -52,7 +52,7 @@ class TimelineItemContentPollFactory @Inject constructor(
isSelected = isSelected,
isDisclosed = content.kind.isDisclosed,
votesCount = votesCount,
progress = progress,
percentage = percentage,
)
}