Skip to content

Commit

Permalink
all: smoother challenge cap (fixes #4803) (#4804)
Browse files Browse the repository at this point in the history
Co-authored-by: dogi <[email protected]>
  • Loading branch information
Okuro3499 and dogi authored Nov 25, 2024
1 parent 2a21f84 commit 9c6a888
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
applicationId "org.ole.planet.myplanet"
minSdkVersion 26
targetSdkVersion 34
versionCode 2109
versionName "0.21.9"
versionCode 2110
versionName "0.21.10"
ndkVersion '21.3.6528147'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ class DashboardActivity : DashboardElementActivity(), OnHomeItemClickListener, N
}

private fun calculateProgress(allVoiceCount: Int): Int {
return (allVoiceCount) * 5
return (allVoiceCount * 5).coerceAtMost(500)
}

private fun setupRealmListeners() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ class DashboardActivity : DashboardElementActivity(), OnHomeItemClickListener, N
}

private fun calculateProgress(allVoiceCount: Int): Int {
return (allVoiceCount) * 5
return (allVoiceCount * 5).coerceAtMost(500)
}

private fun setupRealmListeners() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,8 @@ class MarkdownDialog : DialogFragment() {
setupCloseButton()

val earnedDollars = allVoiceCount * 5
val progressValue = ((earnedDollars.toDouble() / 500) * 100).toInt()
val progressValue = ((earnedDollars.toDouble() / 500) * 100).toInt().coerceAtMost(100)
dialogCampaignChallengeBinding.progressBar.progress = progressValue

}

override fun onStart() {
Expand Down

0 comments on commit 9c6a888

Please sign in to comment.