javafxを使用したAndroid App開発の新機能です(javafxports & gluon-mobileを使用)。
gluon-Apiを使って私のプロジェクトをビルドするときは、MobileApplicationクラスを拡張しますか?
sample programs .Amを使用して自分のバージョンを作成しようとしています。
しかし、この不要なダイアログを表示するAppの開始の開始時に。
がこのアプリケーションの起動時に表示されるこのダイアログについて話しています。
起動時にgluon-mobileダイアログを削除します。
ここに私のコードです。 MobileApplicationクラスを拡張して、samplesに基づいて独自のバージョンのアプリケーションを作成しました。
package com.gluonapplication;
import com.gluonapplication.views.Home;
import com.gluonhq.charm.glisten.application.MobileApplication;
import static com.gluonhq.charm.glisten.application.MobileApplication.HOME_VIEW;
/**
*
* @author Guru
*/
public class MainApplication extends MobileApplication {
public void init()
{
addViewFactory(HOME_VIEW,() -> new Home(HOME_VIEW).getView());
}
public void postinit()
{
}
public void start()
{
}
}
次に、アプリケーションのホームビューを返すHomeクラスを示します。
パッケージcom.gluonapplication.views;
import com.gluonhq.charm.glisten.mvc.View;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.fxml.FXMLLoader;
/**
*
* @author Guru
*/
public class Home {
View view;
String name;
public Home(String name)
{
this.name=name;
}
public View getView()
{
try
{
view=FXMLLoader.load(Home.class.getResource("HomeView.fxml"));
view.setName(name);
}
catch (IOException ex)
{
Logger.getLogger(Home.class.getName()).log(Level.SEVERE, null, ex);
ex.printStackTrace();
return new View(name);
}
return view;
}
}
ここではそのルートビューがあるHomeView.fxmlファイルです。
<?xml version="1.0" encoding="UTF-8"?>
<?import com.gluonhq.charm.glisten.mvc.View?>
<?import com.jfoenix.controls.JFXButton?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.VBox?>
<View prefHeight="600.0" prefWidth="350.0" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1">
<center>
< VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0" spacing="15" BorderPane.alignment="CENTER">
<children>
<Label text="Welcome Back!" />
<AnchorPane prefHeight="254.0" prefWidth="253.0">
<children>
<ImageView fitHeight="254.0" fitWidth="234.0" layoutX="56.0" pickOnBounds="true" preserveRatio="true">
</ImageView>
</children>
</AnchorPane>
<JFXButton text="Continue" />
</children>
</VBox>
事前のおかげで、私が表示され、このダイアログを止める助けてください!
だから、私はライセンスを最初に適用しなければならないだろうし、最初に私のプロジェクトにそれを含める必要があります! –