gradle - Strange javafx app look on android -
i've got problem javafx ported app on android. after first launch looks that:
but when go home screen , rejoin application looks should be.
build.gradle:
buildscript { repositories { mavencentral() maven { url "https://plugins.gradle.org/m2/" url 'http://nexus.gluonhq.com/nexus/content/repositories/releases' } } dependencies { classpath 'org.javafxports:jfxmobile-plugin:1.1.1' } } apply plugin: 'org.javafxports.jfxmobile' repositories { mavencentral() maven { url 'http://nexus.gluonhq.com/nexus/content/repositories/releases' } } mainclassname = 'pl.siemaeniu500.wszywka.main.main' ext.charm_down_version = "2.0.1" dependencies { compile "com.gluonhq:charm-down-common:2.0.1" //compile 'com.gluonhq:charm-glisten:3.0.0' compile 'com.gluonhq:charm:2.1.1' compile files('d:/android/sdk/platforms/android-21/android.jar', 'c:/users/kamil/documents/netbeansprojects/wszywkasounds/jfxdvk-8.60.8.jar') androidruntime 'com.gluonhq:charm-android:2.1.1' iosruntime 'com.gluonhq:charm-ios:2.1.1' desktopruntime 'com.gluonhq:charm-desktop:2.1.1' desktopcompile 'com.github.sarxos:webcam-capture:0.3.10' } jfxmobile { downconfig { version = '3.0.0' plugins 'display', 'lifecycle', 'statusbar', 'storage' } android { manifest = 'src/android/androidmanifest.xml' //compilesdkversion 24 //buildtoolsversion "24.0.3" androidsdk = 'd:/android/sdk' } ios { infoplist = file('src/ios/default-info.plist') forcelinkclasses = [ 'com.gluonhq.**.*', 'javax.annotations.**.*', 'javax.inject.**.*', 'javax.json.**.*', 'org.glassfish.json.**.*' ] } }
main application class:
package pl.siemaeniu500.wszywka.main; import javafx.application.application; import static javafx.application.application.launch; import javafx.fxml.fxmlloader; import javafx.geometry.rectangle2d; import javafx.scene.parent; import javafx.scene.scene; import javafx.stage.screen; import javafx.stage.stage; /** * * @author kamil */ public class main extends application { @override public void start(stage stage) throws exception { rectangle2d visualbounds = screen.getprimary().getvisualbounds(); parent root = fxmlloader.load(getclass().getresource("fxml.fxml")); scene scene = new scene(root, visualbounds.getwidth(), visualbounds.getheight()); stage.setscene(scene); stage.setmaximized(true); //new fxmlcontroller().initialize(); stage.show(); } /** * @param args command line arguments */ public static void main(string[] args) { launch(args); } }
what can cause that?
when set scene size:
scene scene = new scene(root, visualbounds.getwidth(), visualbounds.getheight());
you taking whole screen on device, don't need set this:
stage.setmaximized(true);
removing line should fix issue.
as build script, can simplify dependencies.
in first step, remove charm-down-common. if not using charm glisten can remove charm-* dependencies. if use it, use new version 4+ (uncomment line below).
dependencies { // compile 'com.gluonhq:charm:4.0.1' compile files('d:/android/sdk/platforms/android-21/android.jar', 'c:/users/kamil/documents/netbeansprojects/wszywkasounds/jfxdvk-8.60.8.jar') desktopcompile 'com.github.sarxos:webcam-capture:0.3.10' }
as android , jfxdvk jars, shouldn't there. plugin manage you.
dependencies { // compile 'com.gluonhq:charm:4.0.1' desktopcompile 'com.github.sarxos:webcam-capture:0.3.10' }
reload project (project root, right click, reload project
):
and see them under dependencies -> compile android:
Comments
Post a Comment