From a0012dac6c0798a40dd7ddb1492a31f6640e05e8 Mon Sep 17 00:00:00 2001 From: leewyatt Date: Tue, 23 Jul 2024 21:00:27 +0900 Subject: [PATCH 1/4] Update UI components and enhance readability This commit includes several updates to the UI components in both Header.java and several details pages. Resources that are no longer needed are removed, elements visibility handling is improved, certain icons are set to null, and CSS stylings are adjusted to improve readability. Click event has also been added to HomePageHeader. --- .../dlsc/jfxcentral2/components/Header.java | 2 + .../components/MobileBlogOverviewBox.java | 13 +++--- .../mobile/home/HomePageHeader.java | 7 +++ .../pages/details/MobileBlogDetailsPage.java | 2 - .../pages/details/MobileBookDetailsPage.java | 2 +- .../details/MobileCompanyDetailsPage.java | 2 +- .../pages/details/MobileLearnDetailsPage.java | 1 + .../details/MobileLibraryDetailsPage.java | 3 +- .../MobileShowcaseMobileDetailsPage.java | 4 +- .../pages/details/MobileTipDetailsPage.java | 3 +- .../pages/details/MobileToolDetailsPage.java | 3 +- .../details/MobileTutorialDetailsPage.java | 3 +- .../pages/details/MobileVideoDetailsPage.java | 2 +- .../com/dlsc/jfxcentral2/mobile/mobile.css | 43 ++++++++++++++++++- 14 files changed, 69 insertions(+), 21 deletions(-) diff --git a/components/src/main/java/com/dlsc/jfxcentral2/components/Header.java b/components/src/main/java/com/dlsc/jfxcentral2/components/Header.java index 7acd4620..adcbf0ef 100644 --- a/components/src/main/java/com/dlsc/jfxcentral2/components/Header.java +++ b/components/src/main/java/com/dlsc/jfxcentral2/components/Header.java @@ -28,6 +28,8 @@ public Header() { FontIcon icon = new FontIcon(); icon.getStyleClass().add("header-icon"); icon.iconCodeProperty().bind(iconProperty()); + icon.managedProperty().bind(icon.visibleProperty()); + icon.visibleProperty().bind(icon.iconCodeProperty().isNotNull()); StackPane wrapper = new StackPane(icon); wrapper.getStyleClass().add("header-icon-wrapper"); diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/components/MobileBlogOverviewBox.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/components/MobileBlogOverviewBox.java index f770eb0a..5b78e831 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/components/MobileBlogOverviewBox.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/components/MobileBlogOverviewBox.java @@ -7,7 +7,6 @@ import com.dlsc.jfxcentral2.components.SizeSupport; import com.dlsc.jfxcentral2.model.Size; import com.dlsc.jfxcentral2.utils.ExternalLinkUtil; -import com.dlsc.jfxcentral2.utils.IkonUtil; import com.dlsc.jfxcentral2.utils.StringUtil; import com.rometools.rome.feed.synd.SyndEntry; import javafx.application.Platform; @@ -20,6 +19,7 @@ import javafx.scene.layout.HBox; import javafx.scene.layout.Priority; import javafx.scene.layout.Region; +import javafx.scene.layout.StackPane; import javafx.scene.layout.VBox; import org.kordamp.ikonli.antdesignicons.AntDesignIconsOutlined; import org.kordamp.ikonli.javafx.FontIcon; @@ -42,8 +42,8 @@ public MobileBlogOverviewBox(Blog blog) { // top Header header = new Header(); - header.setTitle("Recent posts found on " + blog.getName()); - header.setIcon(IkonUtil.getModelIkon(Blog.class)); + header.setTitle("Recent posts" ); + header.setIcon(null); // center Label loadingTipsLabel = new Label(StringUtil.LOADING_TIPS, new FontIcon(AntDesignIconsOutlined.CLOUD_DOWNLOAD)); @@ -54,9 +54,12 @@ public MobileBlogOverviewBox(Blog blog) { listView.getStyleClass().addAll("posts-list", "mobile"); listView.setCellFactory(param -> new PostViewCell()); listView.setMaxHeight(Double.MAX_VALUE); - VBox.setVgrow(listView, Priority.ALWAYS); - getChildren().addAll(header, listView); + StackPane listWrapper = new StackPane(listView); + listWrapper.getStyleClass().add("list-wrapper"); + + VBox.setVgrow(listWrapper, Priority.ALWAYS); + getChildren().addAll(header, listWrapper); Service service = new Service<>() { @Override diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/home/HomePageHeader.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/home/HomePageHeader.java index 9ca0f87d..7c614c8a 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/home/HomePageHeader.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/home/HomePageHeader.java @@ -2,6 +2,7 @@ import com.dlsc.jfxcentral2.components.CustomImageView; import com.dlsc.jfxcentral2.components.SizeSupport; +import com.dlsc.jfxcentral2.mobile.pages.MobileHomePage; import com.dlsc.jfxcentral2.model.Size; import javafx.beans.property.ObjectProperty; import javafx.scene.control.Label; @@ -58,6 +59,12 @@ public HomePageHeader() { updateView(); } }); + + // click on the logo to go back to the normal view. + setOnMouseClicked(e -> { + MobileHomePage.getInstance().setContentType(MobileHomePage.ContentType.NORMAL); + requestFocus(); + }); } private void updateView() { diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileBlogDetailsPage.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileBlogDetailsPage.java index be009497..63c461d3 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileBlogDetailsPage.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileBlogDetailsPage.java @@ -1,11 +1,9 @@ package com.dlsc.jfxcentral2.mobile.pages.details; -import com.dlsc.jfxcentral.data.ImageManager; import com.dlsc.jfxcentral.data.model.Blog; import com.dlsc.jfxcentral2.mobile.components.MobileBlogOverviewBox; import com.dlsc.jfxcentral2.mobile.components.MobileCategoryHeader; import com.dlsc.jfxcentral2.model.Size; -import com.dlsc.jfxcentral2.utils.PagePath; import javafx.beans.property.ObjectProperty; import javafx.scene.Node; import javafx.scene.layout.Priority; diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileBookDetailsPage.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileBookDetailsPage.java index 3b4351cc..6699a8e7 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileBookDetailsPage.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileBookDetailsPage.java @@ -5,7 +5,6 @@ import com.dlsc.jfxcentral2.components.overviewbox.BookOverviewBox; import com.dlsc.jfxcentral2.mobile.components.MobileCategoryHeader; import com.dlsc.jfxcentral2.model.Size; -import com.dlsc.jfxcentral2.utils.PagePath; import javafx.beans.property.ObjectProperty; import javafx.scene.Node; import javafx.scene.layout.Priority; @@ -33,6 +32,7 @@ public List content() { // overview BookOverviewBox bookOverviewBox = new BookOverviewBox(book); bookOverviewBox.sizeProperty().bind(sizeProperty()); + bookOverviewBox.setIcon(null); PrettyScrollPane detailsContentPane = new PrettyScrollPane(new StackPane(bookOverviewBox)); detailsContentPane.getStyleClass().add("mobile"); diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileCompanyDetailsPage.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileCompanyDetailsPage.java index 34d04808..5c9245da 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileCompanyDetailsPage.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileCompanyDetailsPage.java @@ -7,7 +7,6 @@ import com.dlsc.jfxcentral2.mobile.components.MobileCategoryHeader; import com.dlsc.jfxcentral2.model.Size; import com.dlsc.jfxcentral2.utils.IkonUtil; -import com.dlsc.jfxcentral2.utils.PagePath; import javafx.beans.property.ObjectProperty; import javafx.scene.Node; import javafx.scene.layout.Priority; @@ -35,6 +34,7 @@ public List content() { // overview CompanyOverviewBox companyOverviewBox = new CompanyOverviewBox(company); companyOverviewBox.sizeProperty().bind(sizeProperty()); + companyOverviewBox.setIcon(null); companyOverviewBox.imageProperty().bind(ImageManager.getInstance().companyImageProperty(company)); PrettyScrollPane detailsContentPane = new PrettyScrollPane(new StackPane(companyOverviewBox)); diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileLearnDetailsPage.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileLearnDetailsPage.java index 62eed5d4..7539963e 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileLearnDetailsPage.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileLearnDetailsPage.java @@ -30,6 +30,7 @@ public List content() { // overview box LearnOverviewBox learnOverviewBox = new LearnOverviewBox(learn); + learnOverviewBox.setIcon(null); learnOverviewBox.sizeProperty().bind(sizeProperty()); PrettyScrollPane detailsContentPane = new PrettyScrollPane(new StackPane(learnOverviewBox)); diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileLibraryDetailsPage.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileLibraryDetailsPage.java index e0db117a..e72f0e67 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileLibraryDetailsPage.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileLibraryDetailsPage.java @@ -1,12 +1,10 @@ package com.dlsc.jfxcentral2.mobile.pages.details; -import com.dlsc.jfxcentral.data.ImageManager; import com.dlsc.jfxcentral.data.model.Library; import com.dlsc.jfxcentral2.components.PrettyScrollPane; import com.dlsc.jfxcentral2.components.overviewbox.LibraryOverviewBox; import com.dlsc.jfxcentral2.mobile.components.MobileCategoryHeader; import com.dlsc.jfxcentral2.model.Size; -import com.dlsc.jfxcentral2.utils.PagePath; import javafx.beans.property.ObjectProperty; import javafx.scene.Node; import javafx.scene.layout.Priority; @@ -33,6 +31,7 @@ public List content() { // overview box LibraryOverviewBox libraryOverviewBox = new LibraryOverviewBox(library); libraryOverviewBox.sizeProperty().bind(sizeProperty()); + libraryOverviewBox.setIcon(null); PrettyScrollPane detailsContentPane = new PrettyScrollPane(new StackPane(libraryOverviewBox)); detailsContentPane.getStyleClass().add("mobile"); diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileShowcaseMobileDetailsPage.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileShowcaseMobileDetailsPage.java index 72dc8405..8d7d1d1a 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileShowcaseMobileDetailsPage.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileShowcaseMobileDetailsPage.java @@ -1,12 +1,10 @@ package com.dlsc.jfxcentral2.mobile.pages.details; -import com.dlsc.jfxcentral.data.ImageManager; import com.dlsc.jfxcentral.data.model.RealWorldApp; import com.dlsc.jfxcentral2.components.PrettyScrollPane; import com.dlsc.jfxcentral2.components.overviewbox.ShowcaseOverviewBox; import com.dlsc.jfxcentral2.mobile.components.MobileCategoryHeader; import com.dlsc.jfxcentral2.model.Size; -import com.dlsc.jfxcentral2.utils.PagePath; import javafx.beans.property.ObjectProperty; import javafx.scene.Node; import javafx.scene.layout.StackPane; @@ -31,6 +29,8 @@ public List content() { // overview box ShowcaseOverviewBox appOverviewBox = new ShowcaseOverviewBox(app); appOverviewBox.sizeProperty().bind(sizeProperty()); + appOverviewBox.setIcon(null); + PrettyScrollPane scrollPane = new PrettyScrollPane(new StackPane(appOverviewBox)); scrollPane.getStyleClass().add("mobile"); diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileTipDetailsPage.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileTipDetailsPage.java index d5291efd..eafba202 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileTipDetailsPage.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileTipDetailsPage.java @@ -1,12 +1,10 @@ package com.dlsc.jfxcentral2.mobile.pages.details; -import com.dlsc.jfxcentral.data.ImageManager; import com.dlsc.jfxcentral.data.model.Tip; import com.dlsc.jfxcentral2.components.PrettyScrollPane; import com.dlsc.jfxcentral2.components.overviewbox.TipOverviewBox; import com.dlsc.jfxcentral2.mobile.components.MobileCategoryHeader; import com.dlsc.jfxcentral2.model.Size; -import com.dlsc.jfxcentral2.utils.PagePath; import javafx.beans.property.ObjectProperty; import javafx.scene.Node; import javafx.scene.layout.Priority; @@ -33,6 +31,7 @@ public List content() { // overview TipOverviewBox tipOverviewBox = new TipOverviewBox(tip); tipOverviewBox.sizeProperty().bind(sizeProperty()); + tipOverviewBox.setIcon(null); PrettyScrollPane detailsContentPane = new PrettyScrollPane(new StackPane(tipOverviewBox)); detailsContentPane.getStyleClass().add("mobile"); diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileToolDetailsPage.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileToolDetailsPage.java index 70c50c4f..475b13df 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileToolDetailsPage.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileToolDetailsPage.java @@ -1,12 +1,10 @@ package com.dlsc.jfxcentral2.mobile.pages.details; -import com.dlsc.jfxcentral.data.ImageManager; import com.dlsc.jfxcentral.data.model.Tool; import com.dlsc.jfxcentral2.components.PrettyScrollPane; import com.dlsc.jfxcentral2.components.overviewbox.ToolOverviewBox; import com.dlsc.jfxcentral2.mobile.components.MobileCategoryHeader; import com.dlsc.jfxcentral2.model.Size; -import com.dlsc.jfxcentral2.utils.PagePath; import javafx.beans.property.ObjectProperty; import javafx.scene.Node; import javafx.scene.layout.Priority; @@ -34,6 +32,7 @@ public List content() { // overview ToolOverviewBox toolOverviewBox = new ToolOverviewBox(tool); toolOverviewBox.sizeProperty().bind(sizeProperty()); + toolOverviewBox.setIcon(null); PrettyScrollPane detailsContentPane = new PrettyScrollPane(new StackPane(toolOverviewBox)); detailsContentPane.getStyleClass().add("mobile"); diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileTutorialDetailsPage.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileTutorialDetailsPage.java index eb9e923b..e7abda7a 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileTutorialDetailsPage.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileTutorialDetailsPage.java @@ -1,12 +1,10 @@ package com.dlsc.jfxcentral2.mobile.pages.details; -import com.dlsc.jfxcentral.data.ImageManager; import com.dlsc.jfxcentral.data.model.Tutorial; import com.dlsc.jfxcentral2.components.PrettyScrollPane; import com.dlsc.jfxcentral2.components.overviewbox.TutorialOverviewBox; import com.dlsc.jfxcentral2.mobile.components.MobileCategoryHeader; import com.dlsc.jfxcentral2.model.Size; -import com.dlsc.jfxcentral2.utils.PagePath; import javafx.beans.property.ObjectProperty; import javafx.scene.Node; import javafx.scene.layout.Priority; @@ -33,6 +31,7 @@ public List content() { // overview TutorialOverviewBox tutorialOverviewBox = new TutorialOverviewBox(tutorial); tutorialOverviewBox.sizeProperty().bind(sizeProperty()); + tutorialOverviewBox.setIcon(null); PrettyScrollPane detailsContentPane = new PrettyScrollPane(new StackPane(tutorialOverviewBox)); detailsContentPane.getStyleClass().add("mobile"); diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileVideoDetailsPage.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileVideoDetailsPage.java index 53cc2a5c..d994f56d 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileVideoDetailsPage.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileVideoDetailsPage.java @@ -1,6 +1,5 @@ package com.dlsc.jfxcentral2.mobile.pages.details; -import com.dlsc.jfxcentral.data.ImageManager; import com.dlsc.jfxcentral.data.model.Video; import com.dlsc.jfxcentral2.components.PrettyScrollPane; import com.dlsc.jfxcentral2.components.overviewbox.VideoOverviewBox; @@ -31,6 +30,7 @@ public List content() { // overview VideoOverviewBox videoOverviewBox = new VideoOverviewBox(video); + videoOverviewBox.setIcon(null); videoOverviewBox.sizeProperty().bind(sizeProperty()); PrettyScrollPane detailsContentPane = new PrettyScrollPane(new StackPane(videoOverviewBox)); diff --git a/mobile/src/main/resources/com/dlsc/jfxcentral2/mobile/mobile.css b/mobile/src/main/resources/com/dlsc/jfxcentral2/mobile/mobile.css index d74ef6af..379a05ff 100644 --- a/mobile/src/main/resources/com/dlsc/jfxcentral2/mobile/mobile.css +++ b/mobile/src/main/resources/com/dlsc/jfxcentral2/mobile/mobile.css @@ -750,6 +750,30 @@ -fx-alignment: top-center; } +.mobile-details-page .overview-box > .content-box > .header { + -fx-background-color: transparent; + -fx-spacing: 10px; +} + +.mobile-details-page .overview-box > .content-box > .header .header-title { + -fx-text-fill: -grey-100; +} + +.mobile-details-page .overview-box > .content-box > .header .spacer { + -fx-background-color: -grey-10; + -fx-max-height: 1px; +} + +.mobile-details-page .overview-box .top-box-wrapper > .top-box { + -fx-spacing: 5px; +} + +.mobile-details-page .overview-box > .content-box .top-box > .field-title, +.mobile-details-page .overview-box > .content-box .top-grid > .field-title { + -fx-text-fill: -grey-20; + -fx-font-size: 13px; +} + .mobile-details-page .company-overview-box .body-box .image-wrapper { -fx-background-color: null; -fx-border-color: -grey-10; @@ -841,8 +865,25 @@ /** ---------------------------------- * MobileBlogOverviewBox */ +.mobile-blog-overview-box { + -fx-background-color: -white; +} + +.mobile-blog-overview-box .header { + -fx-background-color: -grey-10; + -fx-padding: 5px 20px; +} + +.mobile-blog-overview-box .header .header-title { + -fx-text-fill: #646262; +} + +.mobile-blog-overview-box .list-wrapper { + -fx-padding: 0 10px 0 10px; +} + .mobile-blog-overview-box .list-view .post-view-cell { - -fx-padding: 10px 20px 10px 10px; + -fx-padding: 10px 5px 10px 10px; -fx-background-color: -white; } From 72adcbe37c5fe5eaaf8d046d0ec1dadda4f740a8 Mon Sep 17 00:00:00 2001 From: leewyatt Date: Tue, 23 Jul 2024 21:40:35 +0900 Subject: [PATCH 2/4] Hide OverviewBox headers The header visibility in OverviewBox has been bound to the presence of both title and icon. This ensures the header section will be hidden if either is missing. Furthermore, 'setTitle(null)' has been added across various classes, effectively removing the title from those boxes. --- .../jfxcentral2/components/overviewbox/LibraryOverviewBox.java | 2 ++ .../dlsc/jfxcentral2/components/overviewbox/OverviewBox.java | 2 ++ .../mobile/pages/details/MobileBookDetailsPage.java | 1 + .../mobile/pages/details/MobileCompanyDetailsPage.java | 3 ++- .../mobile/pages/details/MobileLearnDetailsPage.java | 3 ++- .../mobile/pages/details/MobileLibraryDetailsPage.java | 1 + .../mobile/pages/details/MobileShowcaseMobileDetailsPage.java | 1 + .../jfxcentral2/mobile/pages/details/MobileTipDetailsPage.java | 1 + .../mobile/pages/details/MobileToolDetailsPage.java | 1 + .../mobile/pages/details/MobileTutorialDetailsPage.java | 1 + .../mobile/pages/details/MobileVideoDetailsPage.java | 3 ++- 11 files changed, 16 insertions(+), 3 deletions(-) diff --git a/components/src/main/java/com/dlsc/jfxcentral2/components/overviewbox/LibraryOverviewBox.java b/components/src/main/java/com/dlsc/jfxcentral2/components/overviewbox/LibraryOverviewBox.java index e1a27642..b5319364 100644 --- a/components/src/main/java/com/dlsc/jfxcentral2/components/overviewbox/LibraryOverviewBox.java +++ b/components/src/main/java/com/dlsc/jfxcentral2/components/overviewbox/LibraryOverviewBox.java @@ -24,6 +24,8 @@ public LibraryOverviewBox(Library library) { Header header = new Header(); header.titleProperty().bind(titleProperty()); header.iconProperty().bind(iconProperty()); + header.managedProperty().bind(header.visibleProperty()); + header.visibleProperty().bind(titleProperty().isNotEmpty().and(iconProperty().isNotNull())); CustomMarkdownView markdownView = new CustomMarkdownView(); markdownView.setBaseURL(DataRepository2.getInstance().getRepositoryDirectoryURL() + "libraries/" + library.getId()); diff --git a/components/src/main/java/com/dlsc/jfxcentral2/components/overviewbox/OverviewBox.java b/components/src/main/java/com/dlsc/jfxcentral2/components/overviewbox/OverviewBox.java index a3cc6943..75b573f6 100644 --- a/components/src/main/java/com/dlsc/jfxcentral2/components/overviewbox/OverviewBox.java +++ b/components/src/main/java/com/dlsc/jfxcentral2/components/overviewbox/OverviewBox.java @@ -32,6 +32,8 @@ public OverviewBox(T model) { Header header = new Header(); header.titleProperty().bind(titleProperty()); header.iconProperty().bind(iconProperty()); + header.managedProperty().bind(header.visibleProperty()); + header.visibleProperty().bind(titleProperty().isNotEmpty().and(iconProperty().isNotNull())); topWrapper = new StackPane(); topWrapper.getStyleClass().add("top-wrapper"); diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileBookDetailsPage.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileBookDetailsPage.java index 6699a8e7..0c5131b2 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileBookDetailsPage.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileBookDetailsPage.java @@ -33,6 +33,7 @@ public List content() { BookOverviewBox bookOverviewBox = new BookOverviewBox(book); bookOverviewBox.sizeProperty().bind(sizeProperty()); bookOverviewBox.setIcon(null); + bookOverviewBox.setTitle(null); PrettyScrollPane detailsContentPane = new PrettyScrollPane(new StackPane(bookOverviewBox)); detailsContentPane.getStyleClass().add("mobile"); diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileCompanyDetailsPage.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileCompanyDetailsPage.java index 5c9245da..3f8f8b82 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileCompanyDetailsPage.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileCompanyDetailsPage.java @@ -34,8 +34,9 @@ public List content() { // overview CompanyOverviewBox companyOverviewBox = new CompanyOverviewBox(company); companyOverviewBox.sizeProperty().bind(sizeProperty()); - companyOverviewBox.setIcon(null); companyOverviewBox.imageProperty().bind(ImageManager.getInstance().companyImageProperty(company)); + companyOverviewBox.setIcon(null); + companyOverviewBox.setTitle(null); PrettyScrollPane detailsContentPane = new PrettyScrollPane(new StackPane(companyOverviewBox)); detailsContentPane.getStyleClass().add("mobile"); diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileLearnDetailsPage.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileLearnDetailsPage.java index 7539963e..9e23a0ed 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileLearnDetailsPage.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileLearnDetailsPage.java @@ -30,8 +30,9 @@ public List content() { // overview box LearnOverviewBox learnOverviewBox = new LearnOverviewBox(learn); - learnOverviewBox.setIcon(null); learnOverviewBox.sizeProperty().bind(sizeProperty()); + learnOverviewBox.setIcon(null); + learnOverviewBox.setTitle(null); PrettyScrollPane detailsContentPane = new PrettyScrollPane(new StackPane(learnOverviewBox)); detailsContentPane.getStyleClass().add("mobile"); diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileLibraryDetailsPage.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileLibraryDetailsPage.java index e72f0e67..4975a6c7 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileLibraryDetailsPage.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileLibraryDetailsPage.java @@ -32,6 +32,7 @@ public List content() { LibraryOverviewBox libraryOverviewBox = new LibraryOverviewBox(library); libraryOverviewBox.sizeProperty().bind(sizeProperty()); libraryOverviewBox.setIcon(null); + libraryOverviewBox.setTitle(null); PrettyScrollPane detailsContentPane = new PrettyScrollPane(new StackPane(libraryOverviewBox)); detailsContentPane.getStyleClass().add("mobile"); diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileShowcaseMobileDetailsPage.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileShowcaseMobileDetailsPage.java index 8d7d1d1a..687c0ae9 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileShowcaseMobileDetailsPage.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileShowcaseMobileDetailsPage.java @@ -30,6 +30,7 @@ public List content() { ShowcaseOverviewBox appOverviewBox = new ShowcaseOverviewBox(app); appOverviewBox.sizeProperty().bind(sizeProperty()); appOverviewBox.setIcon(null); + appOverviewBox.setTitle(null); PrettyScrollPane scrollPane = new PrettyScrollPane(new StackPane(appOverviewBox)); scrollPane.getStyleClass().add("mobile"); diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileTipDetailsPage.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileTipDetailsPage.java index eafba202..c70d5764 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileTipDetailsPage.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileTipDetailsPage.java @@ -32,6 +32,7 @@ public List content() { TipOverviewBox tipOverviewBox = new TipOverviewBox(tip); tipOverviewBox.sizeProperty().bind(sizeProperty()); tipOverviewBox.setIcon(null); + tipOverviewBox.setTitle(null); PrettyScrollPane detailsContentPane = new PrettyScrollPane(new StackPane(tipOverviewBox)); detailsContentPane.getStyleClass().add("mobile"); diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileToolDetailsPage.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileToolDetailsPage.java index 475b13df..e8005dc9 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileToolDetailsPage.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileToolDetailsPage.java @@ -33,6 +33,7 @@ public List content() { ToolOverviewBox toolOverviewBox = new ToolOverviewBox(tool); toolOverviewBox.sizeProperty().bind(sizeProperty()); toolOverviewBox.setIcon(null); + toolOverviewBox.setTitle(null); PrettyScrollPane detailsContentPane = new PrettyScrollPane(new StackPane(toolOverviewBox)); detailsContentPane.getStyleClass().add("mobile"); diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileTutorialDetailsPage.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileTutorialDetailsPage.java index e7abda7a..a4813a60 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileTutorialDetailsPage.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileTutorialDetailsPage.java @@ -32,6 +32,7 @@ public List content() { TutorialOverviewBox tutorialOverviewBox = new TutorialOverviewBox(tutorial); tutorialOverviewBox.sizeProperty().bind(sizeProperty()); tutorialOverviewBox.setIcon(null); + tutorialOverviewBox.setTitle(null); PrettyScrollPane detailsContentPane = new PrettyScrollPane(new StackPane(tutorialOverviewBox)); detailsContentPane.getStyleClass().add("mobile"); diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileVideoDetailsPage.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileVideoDetailsPage.java index d994f56d..e268efc1 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileVideoDetailsPage.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileVideoDetailsPage.java @@ -30,8 +30,9 @@ public List content() { // overview VideoOverviewBox videoOverviewBox = new VideoOverviewBox(video); - videoOverviewBox.setIcon(null); videoOverviewBox.sizeProperty().bind(sizeProperty()); + videoOverviewBox.setIcon(null); + videoOverviewBox.setTitle(null); PrettyScrollPane detailsContentPane = new PrettyScrollPane(new StackPane(videoOverviewBox)); detailsContentPane.getStyleClass().add("mobile"); From aacdf3253d6d0c198680c354f429aff22147c835 Mon Sep 17 00:00:00 2001 From: leewyatt Date: Tue, 23 Jul 2024 21:50:56 +0900 Subject: [PATCH 3/4] Update icon library in mobile components The FontAwesome library used for back icons in MobilePersonDetailView and MobileCategoryHeader classes has been replaced with MaterialDesignA. Updated the icon declaration for backButton to reflect this change. --- .../jfxcentral2/mobile/components/MobileCategoryHeader.java | 4 ++-- .../jfxcentral2/mobile/components/MobilePersonDetailView.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/components/MobileCategoryHeader.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/components/MobileCategoryHeader.java index 8c9024a9..f92897da 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/components/MobileCategoryHeader.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/components/MobileCategoryHeader.java @@ -14,8 +14,8 @@ import javafx.scene.layout.Region; import javafx.scene.layout.StackPane; import org.kordamp.ikonli.Ikon; -import org.kordamp.ikonli.fontawesome.FontAwesome; import org.kordamp.ikonli.javafx.FontIcon; +import org.kordamp.ikonli.materialdesign2.MaterialDesignA; public class MobileCategoryHeader extends StackPane { @@ -27,7 +27,7 @@ public MobileCategoryHeader() { Button backButton = new Button(); backButton.getStyleClass().add("back-button"); - backButton.setGraphic(new FontIcon(FontAwesome.ANGLE_LEFT)); + backButton.setGraphic(new FontIcon(MaterialDesignA.ARROW_LEFT)); MobileLinkUtil.setGoToBackLink(backButton); HBox topBox = new HBox(backButton); diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/components/MobilePersonDetailView.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/components/MobilePersonDetailView.java index 2dd08bf8..62960936 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/components/MobilePersonDetailView.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/components/MobilePersonDetailView.java @@ -26,8 +26,8 @@ import javafx.scene.layout.StackPane; import javafx.scene.layout.VBox; import org.kordamp.ikonli.Ikon; -import org.kordamp.ikonli.fontawesome.FontAwesome; import org.kordamp.ikonli.javafx.FontIcon; +import org.kordamp.ikonli.materialdesign2.MaterialDesignA; import java.util.List; @@ -49,7 +49,7 @@ public MobilePersonDetailView() { Button backButton = new Button(); backButton.getStyleClass().add("back-button"); - backButton.setGraphic(new FontIcon(FontAwesome.ANGLE_LEFT)); + backButton.setGraphic(new FontIcon(MaterialDesignA.ARROW_LEFT)); MobileLinkUtil.setGoToBackLink(backButton); StackPane.setAlignment(backButton, Pos.TOP_LEFT); From 1cdf81e8a0490eea67468395ee9eb22b26c53f79 Mon Sep 17 00:00:00 2001 From: leewyatt Date: Tue, 23 Jul 2024 22:34:57 +0900 Subject: [PATCH 4/4] Adjust mobile category header styling The CSS guidelines for .mobile-category-header have been tuned in this commit. Changes include adjustment of padding in buttons, icon sizes reduction for better aesthetics and grouping, resizing of the category title font for smoother readability, and padding changes for optimal appearance. --- ...egoryHeader.java => MobilePageHeader.java} | 8 +++--- .../pages/MobileLinksOfTheWeekPage.java | 4 +-- .../category/MobileCategoryPageBase.java | 8 +++--- .../pages/details/MobileBlogDetailsPage.java | 4 +-- .../pages/details/MobileBookDetailsPage.java | 4 +-- .../details/MobileCompanyDetailsPage.java | 4 +-- .../pages/details/MobileLearnDetailsPage.java | 4 +-- .../details/MobileLibraryDetailsPage.java | 4 +-- .../MobileShowcaseMobileDetailsPage.java | 4 +-- .../pages/details/MobileTipDetailsPage.java | 4 +-- .../pages/details/MobileToolDetailsPage.java | 4 +-- .../details/MobileTutorialDetailsPage.java | 4 +-- .../pages/details/MobileVideoDetailsPage.java | 4 +-- .../com/dlsc/jfxcentral2/mobile/mobile.css | 28 ++++++++----------- .../demo/HelloMobileCategoryHeader.java | 4 +-- 15 files changed, 44 insertions(+), 48 deletions(-) rename mobile/src/main/java/com/dlsc/jfxcentral2/mobile/components/{MobileCategoryHeader.java => MobilePageHeader.java} (93%) diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/components/MobileCategoryHeader.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/components/MobilePageHeader.java similarity index 93% rename from mobile/src/main/java/com/dlsc/jfxcentral2/mobile/components/MobileCategoryHeader.java rename to mobile/src/main/java/com/dlsc/jfxcentral2/mobile/components/MobilePageHeader.java index f92897da..4a8c4794 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/components/MobileCategoryHeader.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/components/MobilePageHeader.java @@ -17,12 +17,12 @@ import org.kordamp.ikonli.javafx.FontIcon; import org.kordamp.ikonli.materialdesign2.MaterialDesignA; -public class MobileCategoryHeader extends StackPane { +public class MobilePageHeader extends StackPane { - private static final String DEFAULT_STYLE_CLASS = "mobile-category-header"; + private static final String DEFAULT_STYLE_CLASS = "mobile-page-header"; private final SizeSupport sizeSupport = new SizeSupport(this); - public MobileCategoryHeader() { + public MobilePageHeader() { getStyleClass().add(DEFAULT_STYLE_CLASS); Button backButton = new Button(); @@ -34,7 +34,7 @@ public MobileCategoryHeader() { topBox.getStyleClass().add("top-box"); Label categoryTitle = new Label(); - categoryTitle.getStyleClass().add("category-title"); + categoryTitle.getStyleClass().add("title"); categoryTitle.textProperty().bind(titleProperty()); categoryTitle.graphicProperty().bind(Bindings.createObjectBinding(() -> { Ikon icon = getIcon(); diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/MobileLinksOfTheWeekPage.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/MobileLinksOfTheWeekPage.java index ca2179e0..d2669a3e 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/MobileLinksOfTheWeekPage.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/MobileLinksOfTheWeekPage.java @@ -4,7 +4,7 @@ import com.dlsc.jfxcentral.data.model.LinksOfTheWeek; import com.dlsc.jfxcentral2.components.CustomMarkdownView; import com.dlsc.jfxcentral2.components.MobilePageBase; -import com.dlsc.jfxcentral2.mobile.components.MobileCategoryHeader; +import com.dlsc.jfxcentral2.mobile.components.MobilePageHeader; import com.dlsc.jfxcentral2.model.Size; import com.dlsc.jfxcentral2.utils.IkonUtil; import javafx.beans.property.ObjectProperty; @@ -36,7 +36,7 @@ public MobileLinksOfTheWeekPage() { getStyleClass().add(DEFAULT_STYLE_CLASS); // top header - MobileCategoryHeader header = new MobileCategoryHeader(); + MobilePageHeader header = new MobilePageHeader(); header.setTitle("Links of the Week"); header.setIcon(IkonUtil.getModelIkon(LinksOfTheWeek.class)); diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/category/MobileCategoryPageBase.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/category/MobileCategoryPageBase.java index c3691e8f..47cf434e 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/category/MobileCategoryPageBase.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/category/MobileCategoryPageBase.java @@ -2,7 +2,7 @@ import com.dlsc.jfxcentral.data.model.ModelObject; import com.dlsc.jfxcentral2.components.MobilePageBase; -import com.dlsc.jfxcentral2.mobile.components.MobileCategoryHeader; +import com.dlsc.jfxcentral2.mobile.components.MobilePageHeader; import com.dlsc.jfxcentral2.mobile.components.ModelListCell; import com.dlsc.jfxcentral2.mobile.components.ModelListView; import com.dlsc.jfxcentral2.model.Size; @@ -33,7 +33,7 @@ public MobileCategoryPageBase(ObjectProperty size) { public List content() { // header - MobileCategoryHeader header = createCategoryHeader(); + MobilePageHeader header = createCategoryHeader(); header.sizeProperty().bind(sizeProperty()); header.setTitle(getCategoryTitle()); header.setIcon(getCategoryIkon()); @@ -66,8 +66,8 @@ protected Callback, ListCell> cellFactory() { protected abstract ObservableList getCategoryItems(); - protected MobileCategoryHeader createCategoryHeader() { - return new MobileCategoryHeader(); + protected MobilePageHeader createCategoryHeader() { + return new MobilePageHeader(); } protected String getSearchPromptText() { diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileBlogDetailsPage.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileBlogDetailsPage.java index 63c461d3..829e2956 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileBlogDetailsPage.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileBlogDetailsPage.java @@ -2,7 +2,7 @@ import com.dlsc.jfxcentral.data.model.Blog; import com.dlsc.jfxcentral2.mobile.components.MobileBlogOverviewBox; -import com.dlsc.jfxcentral2.mobile.components.MobileCategoryHeader; +import com.dlsc.jfxcentral2.mobile.components.MobilePageHeader; import com.dlsc.jfxcentral2.model.Size; import javafx.beans.property.ObjectProperty; import javafx.scene.Node; @@ -22,7 +22,7 @@ public List content() { Blog blog = getItem(); // header - MobileCategoryHeader header = new MobileCategoryHeader(); + MobilePageHeader header = new MobilePageHeader(); header.sizeProperty().bind(sizeProperty()); header.setTitle(blog.getName()); diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileBookDetailsPage.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileBookDetailsPage.java index 0c5131b2..a182f9ec 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileBookDetailsPage.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileBookDetailsPage.java @@ -3,7 +3,7 @@ import com.dlsc.jfxcentral.data.model.Book; import com.dlsc.jfxcentral2.components.PrettyScrollPane; import com.dlsc.jfxcentral2.components.overviewbox.BookOverviewBox; -import com.dlsc.jfxcentral2.mobile.components.MobileCategoryHeader; +import com.dlsc.jfxcentral2.mobile.components.MobilePageHeader; import com.dlsc.jfxcentral2.model.Size; import javafx.beans.property.ObjectProperty; import javafx.scene.Node; @@ -25,7 +25,7 @@ public List content() { Book book = getItem(); // header - MobileCategoryHeader header = new MobileCategoryHeader(); + MobilePageHeader header = new MobilePageHeader(); header.sizeProperty().bind(sizeProperty()); header.setTitle(book.getName()); diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileCompanyDetailsPage.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileCompanyDetailsPage.java index 3f8f8b82..441d506f 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileCompanyDetailsPage.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileCompanyDetailsPage.java @@ -4,7 +4,7 @@ import com.dlsc.jfxcentral.data.model.Company; import com.dlsc.jfxcentral2.components.PrettyScrollPane; import com.dlsc.jfxcentral2.components.overviewbox.CompanyOverviewBox; -import com.dlsc.jfxcentral2.mobile.components.MobileCategoryHeader; +import com.dlsc.jfxcentral2.mobile.components.MobilePageHeader; import com.dlsc.jfxcentral2.model.Size; import com.dlsc.jfxcentral2.utils.IkonUtil; import javafx.beans.property.ObjectProperty; @@ -26,7 +26,7 @@ public List content() { Company company = getItem(); // header - MobileCategoryHeader header = new MobileCategoryHeader(); + MobilePageHeader header = new MobilePageHeader(); header.sizeProperty().bind(sizeProperty()); header.setIcon(IkonUtil.getModelIkon(Company.class)); header.setTitle(company.getName()); diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileLearnDetailsPage.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileLearnDetailsPage.java index 9e23a0ed..9c19f745 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileLearnDetailsPage.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileLearnDetailsPage.java @@ -3,7 +3,7 @@ import com.dlsc.jfxcentral.data.model.Learn; import com.dlsc.jfxcentral2.components.PrettyScrollPane; import com.dlsc.jfxcentral2.components.overviewbox.LearnOverviewBox; -import com.dlsc.jfxcentral2.mobile.components.MobileCategoryHeader; +import com.dlsc.jfxcentral2.mobile.components.MobilePageHeader; import com.dlsc.jfxcentral2.model.Size; import javafx.beans.property.ObjectProperty; import javafx.scene.Node; @@ -24,7 +24,7 @@ public List content() { Learn learn = getItem(); // header - MobileCategoryHeader header = new MobileCategoryHeader(); + MobilePageHeader header = new MobilePageHeader(); header.sizeProperty().bind(sizeProperty()); header.setTitle(learn.getName()); diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileLibraryDetailsPage.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileLibraryDetailsPage.java index 4975a6c7..de6ce4b6 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileLibraryDetailsPage.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileLibraryDetailsPage.java @@ -3,7 +3,7 @@ import com.dlsc.jfxcentral.data.model.Library; import com.dlsc.jfxcentral2.components.PrettyScrollPane; import com.dlsc.jfxcentral2.components.overviewbox.LibraryOverviewBox; -import com.dlsc.jfxcentral2.mobile.components.MobileCategoryHeader; +import com.dlsc.jfxcentral2.mobile.components.MobilePageHeader; import com.dlsc.jfxcentral2.model.Size; import javafx.beans.property.ObjectProperty; import javafx.scene.Node; @@ -24,7 +24,7 @@ public List content() { Library library = getItem(); // header - MobileCategoryHeader header = new MobileCategoryHeader(); + MobilePageHeader header = new MobilePageHeader(); header.sizeProperty().bind(sizeProperty()); header.setTitle(library.getName()); diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileShowcaseMobileDetailsPage.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileShowcaseMobileDetailsPage.java index 687c0ae9..f0625dfc 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileShowcaseMobileDetailsPage.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileShowcaseMobileDetailsPage.java @@ -3,7 +3,7 @@ import com.dlsc.jfxcentral.data.model.RealWorldApp; import com.dlsc.jfxcentral2.components.PrettyScrollPane; import com.dlsc.jfxcentral2.components.overviewbox.ShowcaseOverviewBox; -import com.dlsc.jfxcentral2.mobile.components.MobileCategoryHeader; +import com.dlsc.jfxcentral2.mobile.components.MobilePageHeader; import com.dlsc.jfxcentral2.model.Size; import javafx.beans.property.ObjectProperty; import javafx.scene.Node; @@ -22,7 +22,7 @@ public List content() { RealWorldApp app = getItem(); // header - MobileCategoryHeader header = new MobileCategoryHeader(); + MobilePageHeader header = new MobilePageHeader(); header.sizeProperty().bind(sizeProperty()); header.setTitle(app.getName()); diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileTipDetailsPage.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileTipDetailsPage.java index c70d5764..c96d35ac 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileTipDetailsPage.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileTipDetailsPage.java @@ -3,7 +3,7 @@ import com.dlsc.jfxcentral.data.model.Tip; import com.dlsc.jfxcentral2.components.PrettyScrollPane; import com.dlsc.jfxcentral2.components.overviewbox.TipOverviewBox; -import com.dlsc.jfxcentral2.mobile.components.MobileCategoryHeader; +import com.dlsc.jfxcentral2.mobile.components.MobilePageHeader; import com.dlsc.jfxcentral2.model.Size; import javafx.beans.property.ObjectProperty; import javafx.scene.Node; @@ -24,7 +24,7 @@ public List content() { Tip tip = getItem(); // header - MobileCategoryHeader header = new MobileCategoryHeader(); + MobilePageHeader header = new MobilePageHeader(); header.sizeProperty().bind(sizeProperty()); header.setTitle(tip.getName()); diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileToolDetailsPage.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileToolDetailsPage.java index e8005dc9..da807dcf 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileToolDetailsPage.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileToolDetailsPage.java @@ -3,7 +3,7 @@ import com.dlsc.jfxcentral.data.model.Tool; import com.dlsc.jfxcentral2.components.PrettyScrollPane; import com.dlsc.jfxcentral2.components.overviewbox.ToolOverviewBox; -import com.dlsc.jfxcentral2.mobile.components.MobileCategoryHeader; +import com.dlsc.jfxcentral2.mobile.components.MobilePageHeader; import com.dlsc.jfxcentral2.model.Size; import javafx.beans.property.ObjectProperty; import javafx.scene.Node; @@ -25,7 +25,7 @@ public List content() { Tool tool = getItem(); // header - MobileCategoryHeader header = new MobileCategoryHeader(); + MobilePageHeader header = new MobilePageHeader(); header.sizeProperty().bind(sizeProperty()); header.setTitle(tool.getName()); diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileTutorialDetailsPage.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileTutorialDetailsPage.java index a4813a60..02009004 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileTutorialDetailsPage.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileTutorialDetailsPage.java @@ -3,7 +3,7 @@ import com.dlsc.jfxcentral.data.model.Tutorial; import com.dlsc.jfxcentral2.components.PrettyScrollPane; import com.dlsc.jfxcentral2.components.overviewbox.TutorialOverviewBox; -import com.dlsc.jfxcentral2.mobile.components.MobileCategoryHeader; +import com.dlsc.jfxcentral2.mobile.components.MobilePageHeader; import com.dlsc.jfxcentral2.model.Size; import javafx.beans.property.ObjectProperty; import javafx.scene.Node; @@ -24,7 +24,7 @@ public List content() { Tutorial tutorial = getItem(); // header - MobileCategoryHeader header = new MobileCategoryHeader(); + MobilePageHeader header = new MobilePageHeader(); header.sizeProperty().bind(sizeProperty()); header.setTitle(tutorial.getName()); diff --git a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileVideoDetailsPage.java b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileVideoDetailsPage.java index e268efc1..3e4c672e 100644 --- a/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileVideoDetailsPage.java +++ b/mobile/src/main/java/com/dlsc/jfxcentral2/mobile/pages/details/MobileVideoDetailsPage.java @@ -3,7 +3,7 @@ import com.dlsc.jfxcentral.data.model.Video; import com.dlsc.jfxcentral2.components.PrettyScrollPane; import com.dlsc.jfxcentral2.components.overviewbox.VideoOverviewBox; -import com.dlsc.jfxcentral2.mobile.components.MobileCategoryHeader; +import com.dlsc.jfxcentral2.mobile.components.MobilePageHeader; import com.dlsc.jfxcentral2.model.Size; import javafx.beans.property.ObjectProperty; import javafx.scene.Node; @@ -24,7 +24,7 @@ public List content() { Video video = getItem(); // header - MobileCategoryHeader header = new MobileCategoryHeader(); + MobilePageHeader header = new MobilePageHeader(); header.sizeProperty().bind(sizeProperty()); header.setTitle(video.getName()); diff --git a/mobile/src/main/resources/com/dlsc/jfxcentral2/mobile/mobile.css b/mobile/src/main/resources/com/dlsc/jfxcentral2/mobile/mobile.css index 379a05ff..4de3a957 100644 --- a/mobile/src/main/resources/com/dlsc/jfxcentral2/mobile/mobile.css +++ b/mobile/src/main/resources/com/dlsc/jfxcentral2/mobile/mobile.css @@ -619,41 +619,37 @@ /** ---------------------------------- * MobileCategoryHeader */ -.mobile-category-header { +.mobile-page-header { -fx-background-color: linear-gradient(from 0% 0% to 0% 100%, rgba(247, 249, 255, 1) 0%, rgba(247, 249, 255, 0) 100%); -fx-alignment: center; } -.mobile-category-header > .top-box { +.mobile-page-header > .top-box { -fx-alignment: center-left; } -.mobile-category-header > .top-box .button { +.mobile-page-header > .top-box .button { -fx-background-color: transparent; - -fx-padding: 5px 10px; + -fx-padding: 5px 7px 5px 10px; } -.mobile-category-header > .top-box .button .ikonli-font-icon { - -fx-icon-size: 25px; +.mobile-page-header > .top-box .button .ikonli-font-icon { + -fx-icon-size: 24px; -fx-icon-color: -grey-60; } -.mobile-category-header .category-title { +.mobile-page-header .title { -fx-graphic-text-gap: 15px; - -fx-font-size: 20px; + -fx-font-size: 17px; -fx-font-family: "Spline Sans SemiBold"; - -fx-padding: 12px 0; -} - -.mobile-category-header .category-title .ikonli-font-icon { - -fx-icon-size: 25px; + -fx-padding: 12px 40px; } -.mobile-category-header .category-title { - -fx-padding: 12px 20px; +.mobile-page-header .title .ikonli-font-icon { + -fx-icon-size: 24px; } -.mobile-category-header .category-title .avatar-view { +.mobile-page-header .title .avatar-view { -fx-avatar-size: 25px; -fx-scale-x: 1.1; -fx-scale-y: 1.1; diff --git a/sampler/src/main/java/com/dlsc/jfxcentral2/demo/HelloMobileCategoryHeader.java b/sampler/src/main/java/com/dlsc/jfxcentral2/demo/HelloMobileCategoryHeader.java index 924c2a98..bdd34ee7 100644 --- a/sampler/src/main/java/com/dlsc/jfxcentral2/demo/HelloMobileCategoryHeader.java +++ b/sampler/src/main/java/com/dlsc/jfxcentral2/demo/HelloMobileCategoryHeader.java @@ -1,7 +1,7 @@ package com.dlsc.jfxcentral2.demo; import com.dlsc.jfxcentral.data.model.Book; -import com.dlsc.jfxcentral2.mobile.components.MobileCategoryHeader; +import com.dlsc.jfxcentral2.mobile.components.MobilePageHeader; import com.dlsc.jfxcentral2.utils.IkonUtil; import javafx.scene.layout.Region; @@ -9,7 +9,7 @@ public class HelloMobileCategoryHeader extends JFXCentralSampleBase { @Override protected Region createControl() { - MobileCategoryHeader header = new MobileCategoryHeader(); + MobilePageHeader header = new MobilePageHeader(); header.setTitle("Books"); header.setIcon(IkonUtil.getModelIkon(Book.class)); return header;