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
Loading and Updating scene customization #14
Comments
Absolutely. I'll add support for customizing it completely, but it will have to wait for some days, I need to finish another project first. |
In the mean time, you can customize some parts of the appearance in app.xml already: <updateText>Updating...</updateText>
<updateLabelStyle>-fx-font-weight: bold;</updateLabelStyle>
<progressBarStyle>-fx-pref-width: 200;</progressBarStyle>
<wrapperStyle>-fx-spacing: 10; -fx-padding: 25;</wrapperStyle> |
Sure, no problem. Just let me know if you need some help with testing. |
Sorry for taking so long with this. My schedule is clearing up a bit, so I started looking at this now @pablovilas - do you think it would be adequate to let the user specify FXML-files to be used for the loading and updating-screens? I would then embed that FXML code inside the manifest. What do you think? |
Hello Edvin, no problem... I completely understand. It will be excelent if you let the user specify FXML or why not a Scene class also (If you have some dynamic controls creation inside). |
We could go for a complete scene graph, but that means embedding code inside the launcher as well. Might not be a big deal though, let me try it out and get back to you. |
It might be hard to determine which classes needs to go inside the launcher, in case of inner classes and such. I think that would have to be offloaded to the user, so you actually have to define the class, and also the path to any resources that should be embedded inside the launcher (in effect, all the classes needed) |
Maybe if we just add more customization options is enough. For example a custom splash background and more stylable options. What do you think? |
I have another idea: Create two interfaces that can be implemented for the two scenes and then you create a separate project where you include |
This actually means that we can clean up the default UI as well, by delivering it through this public class DefaultUIProvider implements UIProvider {
private ProgressBar progressBar;
public Parent createLoader() {
StackPane root = new StackPane(new ProgressIndicator());
root.setPrefSize(200, 80);
root.setPadding(new Insets(10));
return root;
}
public Parent createUpdater(FXManifest manifest) {
progressBar = new ProgressBar();
progressBar.setStyle(manifest.progressBarStyle);
Label label = new Label(manifest.updateText);
label.setStyle(manifest.updateLabelStyle);
VBox wrapper = new VBox(label, progressBar);
wrapper.setStyle(manifest.wrapperStyle);
return wrapper;
}
public void updateProgress(double progress) {
progressBar.setProgress(progress);
}
} |
This is the Interface as I imagine it: public interface UIProvider {
/**
* Create the Node that will be displayed while the launcher is loading resources,
* before the update process starts. The default implementation is an intdeterminate
* progress indicator, but you can return any arbitrary scene graph.
*
* @return The launcher UI
*/
Parent createLoader();
/**
* Create the Node that will be displayed while the launcher is updating resources.
*
* This Node should update it's display whenever the {@link #updateProgress(double)}
* method is called.
*
* @see #updateProgress(double)
* @return The updater Node
*/
Parent createUpdater(FXManifest manifest);
/**
* Called when the update/download progress is changing. The progress is a value between
* 0 and 1, indicating the completion rate of the update process.
*
* @param progress A number between 0 and 1
*/
void updateProgress(double progress);
} |
I really like the idea of having interfaces but I'm not sure if creating another project it's a little too much. If we can only implement that interfaces inside the current project would be awesome but I think it's not possible because how fxlauncher works. Anyway it's an optional feauture so... you do that if you need to. |
Sure, it is absolutely possible to implement it inside the current project as well. Let me flesh this out and I'll show you :) |
Perfect!, please let me know if you need some help with testing |
I have it working, but it is cumbersome for the user to set it up. I want to think about this for a little while and try some other approaches first, OK? :) |
Sure, let me know if you need something. |
Absolutely, thanks :) |
I landed on the UIProvider, almost like the one I pasted here: https://www.youtube.com/watch?v=-6PlFVUgntU I realise that it might be a bit cumbersome to inject the UI into the launcher, but it should just be a matter of copying the lines from the sample project into your build :) |
Great news!!, I'll try it tomorrow. Thanks!. 👏 👏 |
Cool, let me know how it goes :) |
I let you know! :). It's possible to create a new github release? so the maven release will match. |
I totally forgot, thanks for reminding me. I drafted the release now. |
Thanks!!! :) |
Hello Edvin,
I'm wondering if it's possible to customize the loading and updating scenes.
This is the default loading scene:
and this is the updating scene:
I think right now is possible to do some customization to the "updating" scene via app.xml. Would be awesome if we can provide both custom scenes or something like that.
Again, thanks.
The text was updated successfully, but these errors were encountered: