Skip to content

Commit

Permalink
Fixes: Fix Charity categories not loading, added back feedback button…
Browse files Browse the repository at this point in the history
… and other missing labels/fx:id.
  • Loading branch information
AdrianBalunan committed Apr 22, 2026
1 parent b9b2367 commit d232f05
Show file tree
Hide file tree
Showing 3 changed files with 149 additions and 129 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ protected void authTokenisSet(){
public void setCharity(Charity charity) {
this.charity = charity;


CharityDescription.setText(charity.getDescription());
CharityName.setText(charity.getName());

Expand All @@ -97,25 +98,27 @@ public void setCharity(Charity charity) {

// Sets key values to a List<Double>
String input = charity.getKeyValues();

String[] parts = input.split(":");
List<Double> numbers = new ArrayList<>();

for (String part : parts) {
part = part.replace(",", ".");
numbers.add(Double.parseDouble(part));
if (input != null) {

String[] parts = input.split(":");
List<Double> numbers = new ArrayList<>();

for (String part : parts) {
part = part.replace(",", ".");
numbers.add(Double.parseDouble(part));
}

// Sets the value of each arc and label
setArc(keyValueInnsamlingArc, numbers.getFirst());
keyValueInnsamlingLabel.setText(String.format("%.1f%%", numbers.getFirst()));
setArc(keyValueAdminArc, numbers.get(1));
keyValueAdminLabel.setText(String.format("%.1f%%", numbers.get(1)));
setArc(keyValueFormaalArc, numbers.getLast());
keyValueFormaalLabel.setText(String.format("%.1f%%", numbers.getLast()));
}

// Sets the value of each arc and label
setArc(keyValueInnsamlingArc, numbers.getFirst());
keyValueInnsamlingLabel.setText(String.format("%.1f%%", numbers.getFirst()));
setArc(keyValueAdminArc, numbers.get(1));
keyValueAdminLabel.setText(String.format("%.1f%%", numbers.get(1)));
setArc(keyValueFormaalArc, numbers.getLast());
keyValueFormaalLabel.setText(String.format("%.1f%%", numbers.getLast()));

// Sets the categories
setCategories(charity.getCategory());
// Sets the categories
setCategories(charity.getCategory());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ public static void LoadScene(String sceneName, Stage stage, Charity charity, Str
stage.setScene(scene);
stage.setFullScreen(true);
stage.show();
// Re-enter fullscreen when restored from taskbar
stage.iconifiedProperty().addListener((obs, wasIconified, isNowIconified) -> {
if (!isNowIconified) {
stage.setFullScreen(true);
Expand Down
Loading

0 comments on commit d232f05

Please sign in to comment.