Skip to content

Commit

Permalink
Merge pull request #1127 from PhenoApps/percent_max_fix
Browse files Browse the repository at this point in the history
display with default max of 100 if max not set
  • Loading branch information
trife authored Jan 3, 2025
2 parents ed8125e + 29d5a84 commit fe9596f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ public void afterLoadExists(CollectActivity act, String value) {

if (value != null && !value.equals("NA") && !value.isEmpty()) {

seekBar.setMax(Integer.parseInt(getCurrentTrait().getMaximum()));
// Default to max 100 if maximum is not set
String maxString = getCurrentTrait().getMaximum();
int max = (maxString != null && !maxString.isEmpty()) ? Integer.parseInt(maxString) : 100;
seekBar.setMax(max);

int textColor = value.equals(getDefaultValue()) ? Color.BLACK : Color.parseColor(getDisplayColor());
setCurrentValueText(value, textColor);
Expand Down

0 comments on commit fe9596f

Please sign in to comment.