Here you go.
[java]
This patch file was generated by NetBeans IDE
Following Index: paths are relative to: D:UserspotterecDocumentsjMonkeyProjects_NightlyjME3srcandroidcomjme3app
This patch can be applied using context Tools: Patch action on respective folder.
It uses platform neutral UTF-8 encoding and n newlines.
Above lines and this line are ignored by the patching process.
Index: AndroidHarness.java
— AndroidHarness.java Base (BASE)
+++ AndroidHarness.java Locally Modified (Based On LOCAL)
@@ -7,8 +7,12 @@
import android.opengl.GLSurfaceView;
import android.os.Bundle;
import android.view.Display;
+import android.view.View;
+import android.view.ViewGroup.LayoutParams;
import android.view.Window;
import android.view.WindowManager;
+import android.widget.FrameLayout;
+import android.widget.ImageView;
import android.widget.TextView;
import com.jme3.input.android.AndroidInput;
import com.jme3.input.controls.TouchListener;
@@ -86,6 +90,13 @@
protected boolean screenShowTitle = true;
/**
-
* Splash Screen picture Resource ID. If a Splash Screen is desired, set<br />
-
* splashPicID to the value of the Resource ID (i.e. R.drawable.picname).<br />
-
* If splashPicID = 0, then no splash screen will be displayed.<br />
-
*/<br />
- protected int splashPicID = 0;
+
- /**
- Set the screen orientation, default is SENSOR
- ActivityInfo.SCREEN_ORIENTATION_* constants
- package android.content.pm.ActivityInfo
@@ -102,6 +113,8 @@
protected OGLESContext ctx;
protected GLSurfaceView view = null;
protected boolean isGLThreadPaused = true;
- private ImageView splashImageView = null;
- private FrameLayout frameLayout = null;
final private String ESCAPE_EVENT = "TouchEscape";
static {
@@ -167,7 +180,6 @@
app.start();
ctx = (OGLESContext) app.getContext();
view = ctx.createView(input, eglConfigType, eglConfigVerboseLogging);
-
setContentView(view);<br />
// Set the screen reolution
WindowManager wind = this.getWindowManager();
@@ -176,6 +188,9 @@
AppSettings s = ctx.getSettings();
logger.log(Level.INFO, "Settings: Width {0} Height {1}", new Object[]{s.getWidth(), s.getHeight()});
+
+ layoutDisplay();
+
} catch (Exception ex) {
handleError("Class " + appClass + " init failed", ex);
setContentView(new TextView(this));
@@ -310,4 +325,49 @@
}
}
+
+ public void layoutDisplay() {
+ logger.log(Level.INFO, "Splash Screen Picture Resource ID: {0}", splashPicID);
+ if (splashPicID != 0) {
+ LayoutParams lp = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
+
+ frameLayout = new FrameLayout(this);
+ frameLayout.setLayoutParams(lp);
+
+ splashImageView = new ImageView(this);
+ splashImageView.setImageResource(splashPicID);
+ splashImageView.setLayoutParams(lp);
+
+ frameLayout.addView(view);
+ frameLayout.addView(splashImageView, lp);
+
+ setContentView(frameLayout);
+ logger.log(Level.INFO, "Splash Screen Created");
+ } else {
+ logger.log(Level.INFO, "Splash Screen Skipped.");
+ setContentView(view);
}
+
+ }
+
+ public void removeSplashScreen() {
+ logger.log(Level.INFO, "Splash Screen Picture Resource ID: {0}", splashPicID);
+ if (splashPicID != 0) {
+ if (frameLayout != null) {
+ if (splashImageView != null) {
+ this.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ splashImageView.setVisibility(View.INVISIBLE);
+ frameLayout.removeView(splashImageView);
+ }
+ });
+ } else {
+ logger.log(Level.INFO, "splashImageView is null");
+ }
+ } else {
+ logger.log(Level.INFO, "frameLayout is null");
+ }
+ }
+ }
+}
[/java]
[java]
# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: D:UserspotterecDocumentsjMonkeyProjects_NightlyjME3srcandroidcomjme3systemandroid
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and n newlines.
# Above lines and this line are ignored by the patching process.
Index: OGLESContext.java
--- OGLESContext.java Base (BASE)
+++ OGLESContext.java Locally Modified (Based On LOCAL)
@@ -83,6 +83,7 @@
protected boolean autoFlush = true;
protected AndroidInput view;
+ private boolean firstDrawFrame = true;
private long milliStart;
private long milliDelta;
@@ -408,9 +409,17 @@
milliStart = System.currentTimeMillis();
-
listener.update();
+ // call to AndroidHarness to remove the splash screen, if present.
+ // call after listener.update() to make sure no gap between
+ // splash screen going away and app display being shown.
+ if (firstDrawFrame) {
+ final Context ctx = this.view.getContext();
+ if (ctx instanceof AndroidHarness) {
+ ((AndroidHarness)ctx).removeSplashScreen();
+ }
+ }
if (autoFlush)
{
@@ -431,7 +440,7 @@
}
-
+ firstDrawFrame = false;
}
@Override
[/java]