Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New mobile version. #648

Merged
merged 55 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
354cd6b
Refactor search button functionality in MobileHomePage
leewyatt Jul 9, 2024
120747c
fix: Correct incomplete image display in Blogs list
leewyatt Jul 9, 2024
9c8b38e
Merge pull request #627 from dlsc-software-consulting-gmbh/fix-blog-p…
dlemmermann Jul 10, 2024
1ae4f05
More reflection json data for the native image generation.
dlemmermann Jul 10, 2024
6f93038
Merge remote-tracking branch 'origin/develop' into develop
dlemmermann Jul 10, 2024
7697ef9
Implement Singleton pattern and enhance mobile navigation
leewyatt Jul 10, 2024
0eadfc4
Merge pull request #626 from dlsc-software-consulting-gmbh/ehancement…
dlemmermann Jul 10, 2024
6cdacb5
Merge pull request #628 from dlsc-software-consulting-gmbh/feature-mo…
dlemmermann Jul 10, 2024
b592a5e
Simplify MobileCategoryHeader instantiation
leewyatt Jul 10, 2024
87fd249
Sort blog posts by date
leewyatt Jul 10, 2024
f5a0100
Remove header image bindings in detail pages
leewyatt Jul 10, 2024
732cee5
Set initial page index randomly in WelcomePageView
leewyatt Jul 10, 2024
90b1026
Refactor MobilePersonDetailsPage and add MobilePersonDetailView
leewyatt Jul 10, 2024
43223b5
Merge pull request #629 from dlsc-software-consulting-gmbh/enhancemen…
dlemmermann Jul 13, 2024
ad1ecd6
Merge pull request #630 from dlsc-software-consulting-gmbh/fix-sort-b…
dlemmermann Jul 13, 2024
5eb9a3c
Merge pull request #632 from dlsc-software-consulting-gmbh/enhancemen…
dlemmermann Jul 13, 2024
8968a76
Refactor mobile home page and person detail view
leewyatt Jul 19, 2024
08459ce
Refactor code for updating person detail view
leewyatt Jul 19, 2024
2426aa2
Add video category and adjust display settings
leewyatt Jul 19, 2024
bee5b25
Add support for opening documentation links
leewyatt Jul 19, 2024
023f822
Merge branch 'develop' into feature-mobile-person-details-view
dlemmermann Jul 22, 2024
3b6ef06
Merge pull request #633 from dlsc-software-consulting-gmbh/feature-mo…
dlemmermann Jul 22, 2024
9a8b5bf
Merge pull request #634 from dlsc-software-consulting-gmbh/feature-do…
dlemmermann Jul 22, 2024
6d6bbe5
Restyled the bottom bar.
dlemmermann Jul 22, 2024
e834ddb
Changed the way we set the prompt text.
dlemmermann Jul 22, 2024
9283f2f
Now showing the "play video" button instead of the "youtube" button f…
dlemmermann Jul 22, 2024
8f1153f
Update home button action in BottomMenuBar
leewyatt Jul 22, 2024
bd8512c
Merge pull request #635 from dlsc-software-consulting-gmbh/enhancemen…
dlemmermann Jul 22, 2024
973de28
Update UI elements and modify button interaction
leewyatt Jul 22, 2024
a4298ed
Merge pull request #636 from dlsc-software-consulting-gmbh/fix-remove…
dlemmermann Jul 22, 2024
9dec582
Refactor MobileCategoryPageBase and MobileDetailsPageBase to extend M…
leewyatt Jul 22, 2024
b024715
Remove onOpenWebLink method from reflect-config
leewyatt Jul 22, 2024
bb2d4a1
Update style and structure for mobile page
leewyatt Jul 22, 2024
4e63296
Update CSS rules for markdown-code.
leewyatt Jul 22, 2024
fed1e96
Restore accidentally deleted document navigation rules.
leewyatt Jul 22, 2024
7b24597
Merge pull request #637 from dlsc-software-consulting-gmbh/feature-ad…
dlemmermann Jul 23, 2024
a0012da
Update UI components and enhance readability
leewyatt Jul 23, 2024
72adcbe
Hide OverviewBox headers
leewyatt Jul 23, 2024
aacdf32
Update icon library in mobile components
leewyatt Jul 23, 2024
1cdf81e
Adjust mobile category header styling
leewyatt Jul 23, 2024
8167245
Merge pull request #638 from dlsc-software-consulting-gmbh/develop-ad…
dlemmermann Jul 23, 2024
2c8e163
Add Learn Part and related pages.
leewyatt Jul 23, 2024
2848405
Merge pull request #639 from dlsc-software-consulting-gmbh/feature-ad…
dlemmermann Jul 23, 2024
012b367
Implement lifecycle methods for mobile views
leewyatt Jul 24, 2024
a185843
Merge pull request #644 from dlsc-software-consulting-gmbh/feature-im…
dlemmermann Jul 24, 2024
cfc8886
Add pagination components and enhance header text display, update styles
leewyatt Jul 24, 2024
8bf08e8
Merge pull request #645 from dlsc-software-consulting-gmbh/feature-pa…
dlemmermann Jul 25, 2024
be64bc1
More reflection config updates.
dlemmermann Jul 25, 2024
44ada54
Refine logic for determining short titles.
leewyatt Jul 25, 2024
b20fd6b
Merge pull request #646 from dlsc-software-consulting-gmbh/fix-text-w…
dlemmermann Jul 25, 2024
53fbc51
Add LinkedObjectsBox component to mobile detail views
leewyatt Jul 25, 2024
d15dd68
Refactor WelcomePage components to IntroPane and IntroCard
leewyatt Jul 26, 2024
2bb3320
Shuffle intro pages for variety
leewyatt Jul 26, 2024
de8b30d
Refactor PageDate to IntroCardData in IntroPane
leewyatt Jul 26, 2024
53b6679
Merge pull request #647 from dlsc-software-consulting-gmbh/fetaure-li…
dlemmermann Jul 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.dlsc.jfxcentral.data.model.Tutorial;
import com.dlsc.jfxcentral.data.model.Video;
import com.dlsc.jfxcentral2.app.pages.MobileRefreshPage;
import com.dlsc.jfxcentral2.events.OpenWebLinkEvent;
import com.dlsc.jfxcentral2.events.RepositoryUpdatedEvent;
import com.dlsc.jfxcentral2.mobile.components.BottomMenuBar;
import com.dlsc.jfxcentral2.mobile.components.MobileDevelopToolBar;
Expand All @@ -25,6 +26,7 @@
import com.dlsc.jfxcentral2.mobile.pages.category.MobileBlogsCategoryPage;
import com.dlsc.jfxcentral2.mobile.pages.category.MobileBooksCategoryPage;
import com.dlsc.jfxcentral2.mobile.pages.category.MobileCompaniesCategoryPage;
import com.dlsc.jfxcentral2.mobile.pages.category.MobileDocPage;
import com.dlsc.jfxcentral2.mobile.pages.category.MobileLearnJavaFXCategoryPage;
import com.dlsc.jfxcentral2.mobile.pages.category.MobileLearnMobileCategoryPage;
import com.dlsc.jfxcentral2.mobile.pages.category.MobileLearnRaspberryPiCategoryPage;
Expand All @@ -49,11 +51,14 @@
import com.dlsc.jfxcentral2.model.Size;
import com.dlsc.jfxcentral2.utils.EventBusUtil;
import com.dlsc.jfxcentral2.utils.MobileLinkUtil;
import com.dlsc.jfxcentral2.utils.MobileResponse;
import com.dlsc.jfxcentral2.utils.MobileRoute;
import com.dlsc.jfxcentral2.utils.MobileRouter;
import com.dlsc.jfxcentral2.utils.NodeUtil;
import com.dlsc.jfxcentral2.utils.OSUtil;
import com.dlsc.jfxcentral2.utils.PagePath;
import com.dlsc.jfxcentral2.utils.Subscribe;
import com.gluonhq.attach.browser.BrowserService;
import com.gluonhq.attach.display.DisplayService;
import fr.brouillard.oss.cssfx.CSSFX;
import javafx.application.Application;
Expand All @@ -70,6 +75,8 @@
import javafx.util.Callback;

import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.Locale;
import java.util.Objects;
import java.util.function.Supplier;
Expand Down Expand Up @@ -148,6 +155,22 @@ public void onRepositoryUpdated(RepositoryUpdatedEvent event) {
notchPane.setManaged(event.isUpdated());
}

@Subscribe
public void onOpenWebLink(OpenWebLinkEvent event) {
String link = event.link();
if (OSUtil.isNative()) {
BrowserService.create().ifPresent(service -> {
try {
service.launchExternalBrowser(link);
} catch (IOException | URISyntaxException e) {
throw new RuntimeException(e);
}
});
} else {
getHostServices().showDocument(link);
}
}

private void updateSizeProperty(Scene scene) {
double sceneWidth = scene.getWidth();
if (sceneWidth < 760) {
Expand All @@ -165,15 +188,18 @@ private MobileRouter createMobileRouter() {
boolean repositoryUpdated = RepositoryManager.isRepositoryUpdated();
EventBusUtil.post(new RepositoryUpdatedEvent(repositoryUpdated));
if (repositoryUpdated) {
return new MobileHomePage(size);
MobileHomePage mobileHomePage = MobileHomePage.getInstance();
mobileHomePage.sizeProperty().bind(size);
return MobileResponse.view(r, mobileHomePage);
} else {
return new MobileRefreshPage(size);
return MobileResponse.redirect(r, PagePath.REFRESH);
}
}))
.and(MobileRoute.get(PagePath.REFRESH, r -> new MobileRefreshPage(size)))
.and(MobileRoute.get(PagePath.REFRESH, r -> MobileResponse.view(r, new MobileRefreshPage(size))))
.and(MobileRoute.redirect("/index", PagePath.HOME))
.and(MobileRoute.redirect("/home", PagePath.HOME))
.and(MobileRoute.get(PagePath.LINKS, r -> new MobileLinksOfTheWeekPage(size)))
.and(MobileRoute.get(PagePath.LINKS, r -> MobileResponse.view(r, new MobileLinksOfTheWeekPage(size))))
.and(MobileRoute.get(PagePath.DOCUMENTATION, r -> MobileResponse.view(r, new MobileDocPage(size))))
.and(createCategoryOrDetailRoute(PagePath.SHOWCASES, RealWorldApp.class, () -> new MobileShowcasesCategoryPage(size), id -> new MobileShowcaseMobileDetailsPage(size, id)))
.and(createCategoryOrDetailRoute(PagePath.REAL_WORLD, RealWorldApp.class, () -> new MobileShowcasesCategoryPage(size), id -> new MobileShowcaseMobileDetailsPage(size, id)))
.and(createCategoryOrDetailRoute(PagePath.LIBRARIES, Library.class, () -> new MobileLibrariesCategoryPage(size), id -> new MobileLibraryDetailsPage(size, id)))
Expand All @@ -196,13 +222,12 @@ private MobileRoute createCategoryOrDetailRoute(String path, Class<? extends Mod
if (index > 0 && clazz != null) {
String id = url.substring(index + 1).trim();
if (!DataRepository2.getInstance().isValidId(clazz, id)) {
return new Label("Error: 404");
return MobileResponse.view(url, new Label("Error: 404"));
}
return detailedResponse.call(id);
return MobileResponse.view(url, detailedResponse.call(id));
}
return categoryResponse.get();
return MobileResponse.view(url, categoryResponse.get());
});

}

public static void main(String[] args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.dlsc.jfxcentral2.app.RepositoryManager;
import com.dlsc.jfxcentral2.app.utils.RepositoryUpdater;
import com.dlsc.jfxcentral2.components.CustomImageView;
import com.dlsc.jfxcentral2.mobile.components.WelcomePageView;
import com.dlsc.jfxcentral2.mobile.components.IntroPane;
import com.dlsc.jfxcentral2.model.Size;
import com.dlsc.jfxcentral2.utils.MobileLinkUtil;
import com.dlsc.jfxcentral2.utils.PagePath;
Expand Down Expand Up @@ -44,12 +44,15 @@ public MobileRefreshPage(ObjectProperty<Size> size) {
invalidationListener.invalidated(null);
});

// top part
WelcomePageView welcomePageView = new WelcomePageView();
StackPane topBox = new StackPane(welcomePageView);
topBox.getStyleClass().add("top-box");
// top part (logo)
CustomImageView logo = new CustomImageView();
logo.getStyleClass().addAll("jfx-central-logo", "color");

Label loadLabel = new Label("Progress download github repository. 38%");
// center part (intro pane)
IntroPane introPane = new IntroPane();
VBox.setVgrow(introPane, Priority.ALWAYS);

Label loadLabel = new Label();
loadLabel.getStyleClass().add("load-label");
loadLabel.setManaged(false);
loadLabel.setVisible(false);
Expand Down Expand Up @@ -79,24 +82,10 @@ public MobileRefreshPage(ObjectProperty<Size> size) {
repositoryUpdater.performUpdate(false);
});

Label welcomeLabel = new Label("Welcome to JFXCentral");
welcomeLabel.getStyleClass().add("welcome-label");
welcomeLabel.managedProperty().bind(welcomeLabel.visibleProperty());
welcomeLabel.visibleProperty().bind(startButton.visibleProperty().not());

Label descLabel = new Label("Home to anything related to JavaFX.");
descLabel.getStyleClass().add("desc-label");
descLabel.managedProperty().bind(descLabel.visibleProperty());
descLabel.visibleProperty().bind(startButton.visibleProperty().not());

VBox bottomBox = new VBox(welcomeLabel, descLabel, startButton, loadLabel);
VBox bottomBox = new VBox(startButton, loadLabel);
bottomBox.getStyleClass().add("bottom-box");
VBox.setVgrow(bottomBox, Priority.ALWAYS);

CustomImageView logo = new CustomImageView();
logo.getStyleClass().addAll("jfx-central-logo", "color");

VBox content = new VBox(topBox, bottomBox, logo);
VBox content = new VBox(logo, introPane, bottomBox);
content.getStyleClass().add("content-box");
getChildren().add(content);

Expand Down
Loading
Loading