diff --git a/desktop/src/main/java/bisq/desktop/main/content/academy/AcademyView.java b/desktop/src/main/java/bisq/desktop/main/content/academy/AcademyView.java index f29e5f385a..aaef70159d 100644 --- a/desktop/src/main/java/bisq/desktop/main/content/academy/AcademyView.java +++ b/desktop/src/main/java/bisq/desktop/main/content/academy/AcademyView.java @@ -29,8 +29,8 @@ import javafx.scene.layout.VBox; public abstract class AcademyView extends View { - protected final Label headline, subHeadline, overviewHeadline, overview, contentHeadline, content; - protected final Hyperlink learnMore; + protected final Label headline, subHeadline; + protected Hyperlink learnMore; public AcademyView(M model, C controller) { super(new VBox(10), model, controller); @@ -46,34 +46,41 @@ public AcademyView(M model, C controller) { subHeadline.getStyleClass().addAll("font-size-14", "font-light", "text-fill-grey-dimmed"); subHeadline.setWrapText(true); - overviewHeadline = new Label(Res.get("academy.overview")); - overviewHeadline.getStyleClass().addAll("font-size-16", "font-light"); - overviewHeadline.setWrapText(true); - overview = new Label(Res.get("academy." + key + ".overview")); - overview.getStyleClass().addAll("font-size-12", "font-light", "bisq-line-spacing-01"); - overview.setWrapText(true); + VBox.setMargin(headline, new Insets(0, 0, 0, 0)); + root.getChildren().addAll(headline, subHeadline); + + } - contentHeadline = new Label(Res.get("academy." + key + ".content.headline")); - contentHeadline.getStyleClass().addAll("font-size-16", "font-light"); - contentHeadline.setWrapText(true); + protected Label addHeadlineLabel(String headlineKey) { + Label label = new Label(Res.get("academy." + getKey() + "." + headlineKey)); + label.getStyleClass().addAll("font-size-16", "font-light"); + label.setWrapText(true); + root.getChildren().add(label); + return label; + } - content = new Label(Res.get("academy." + key + ".content")); - content.getStyleClass().addAll("font-size-12", "font-light", "bisq-line-spacing-01"); - content.setWrapText(true); + protected Label addContentLabel(String contentKey) { + Label label = new Label(Res.get("academy." + getKey() + "." + contentKey)); + label.getStyleClass().addAll("font-size-12", "font-light", "bisq-line-spacing-01"); + label.setWrapText(true); + root.getChildren().add(label); + return label; + } + protected Hyperlink addLearnMoreHyperlink() { learnMore = new Hyperlink(Res.get("action.learnMore")); learnMore.getStyleClass().addAll("font-size-12", "text-fill-green"); + root.getChildren().add(learnMore); + return learnMore; + } - VBox.setMargin(headline, new Insets(0, 0, 0, 0)); - VBox.setMargin(overviewHeadline, new Insets(25, 0, 0, 0)); - VBox.setMargin(contentHeadline, new Insets(35, 0, 0, 0)); - VBox.setMargin(content, new Insets(0, 0, 15, 0)); - root.getChildren().addAll(headline, subHeadline, - overviewHeadline, overview, - contentHeadline, content, - learnMore); + protected void setHeadlineMargin(Label headlineLabel) { + VBox.setMargin(headlineLabel, new Insets(35, 0, 0, 0)); + } + protected void setLastLabelMargin(Label lastLabel) { + VBox.setMargin(lastLabel, new Insets(0, 0, 15, 0)); } protected abstract String getIconId(); diff --git a/desktop/src/main/java/bisq/desktop/main/content/academy/bisq/BisqAcademyController.java b/desktop/src/main/java/bisq/desktop/main/content/academy/bisq/BisqAcademyController.java index 411cb1694f..ebb2e05d5b 100644 --- a/desktop/src/main/java/bisq/desktop/main/content/academy/bisq/BisqAcademyController.java +++ b/desktop/src/main/java/bisq/desktop/main/content/academy/bisq/BisqAcademyController.java @@ -30,6 +30,9 @@ public BisqAcademyController(ServiceProvider serviceProvider) { view = new BisqAcademyView(model, this); } + public boolean useCaching() { + return false; + } @Override public void onActivate() { } diff --git a/desktop/src/main/java/bisq/desktop/main/content/academy/bisq/BisqAcademyView.java b/desktop/src/main/java/bisq/desktop/main/content/academy/bisq/BisqAcademyView.java index cc66a9706d..f2f28e2d42 100644 --- a/desktop/src/main/java/bisq/desktop/main/content/academy/bisq/BisqAcademyView.java +++ b/desktop/src/main/java/bisq/desktop/main/content/academy/bisq/BisqAcademyView.java @@ -18,6 +18,10 @@ package bisq.desktop.main.content.academy.bisq; import bisq.desktop.main.content.academy.AcademyView; +import javafx.geometry.Insets; +import javafx.scene.control.Hyperlink; +import javafx.scene.control.Label; +import javafx.scene.layout.VBox; import lombok.extern.slf4j.Slf4j; @Slf4j @@ -25,6 +29,19 @@ public class BisqAcademyView extends AcademyView