|
@@ -110,6 +110,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
|
|
private Button mWiFiSettingsButton;
|
|
private Button mWiFiSettingsButton;
|
|
|
|
|
|
private boolean use_32_bits=false;
|
|
private boolean use_32_bits=false;
|
|
|
|
+ private boolean use_immersive=false;
|
|
private boolean mStatePaused;
|
|
private boolean mStatePaused;
|
|
private int mState;
|
|
private int mState;
|
|
|
|
|
|
@@ -374,6 +375,8 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
|
|
mRemoteService.onClientUpdated(mDownloaderClientStub.getMessenger());
|
|
mRemoteService.onClientUpdated(mDownloaderClientStub.getMessenger());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
protected void onCreate(Bundle icicle) {
|
|
protected void onCreate(Bundle icicle) {
|
|
|
|
|
|
@@ -402,6 +405,19 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
|
|
boolean has_extra = i< command_line.length -1;
|
|
boolean has_extra = i< command_line.length -1;
|
|
if (command_line[i].equals("-use_depth_32")) {
|
|
if (command_line[i].equals("-use_depth_32")) {
|
|
use_32_bits=true;
|
|
use_32_bits=true;
|
|
|
|
+ } else if (command_line[i].equals("-use_immersive")) {
|
|
|
|
+ use_immersive=true;
|
|
|
|
+ if(Build.VERSION.SDK_INT >= 19.0){ // check if the application runs on an android 4.4+
|
|
|
|
+ window.getDecorView().setSystemUiVisibility(
|
|
|
|
+ View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
|
|
|
+ | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
|
|
|
+ | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
|
|
|
+ | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
|
|
|
|
+ | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
|
|
|
|
+ | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
|
|
|
|
+
|
|
|
|
+ UiChangeListener();
|
|
|
|
+ }
|
|
} else if (command_line[i].equals("-use_apk_expansion")) {
|
|
} else if (command_line[i].equals("-use_apk_expansion")) {
|
|
use_apk_expansion=true;
|
|
use_apk_expansion=true;
|
|
} else if (has_extra && command_line[i].equals("-apk_expansion_md5")) {
|
|
} else if (has_extra && command_line[i].equals("-apk_expansion_md5")) {
|
|
@@ -560,6 +576,16 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
|
|
mView.onResume();
|
|
mView.onResume();
|
|
mSensorManager.registerListener(this, mAccelerometer, SensorManager.SENSOR_DELAY_NORMAL);
|
|
mSensorManager.registerListener(this, mAccelerometer, SensorManager.SENSOR_DELAY_NORMAL);
|
|
GodotLib.focusin();
|
|
GodotLib.focusin();
|
|
|
|
+ if(use_immersive && Build.VERSION.SDK_INT >= 19.0){ // check if the application runs on an android 4.4+
|
|
|
|
+ Window window = getWindow();
|
|
|
|
+ window.getDecorView().setSystemUiVisibility(
|
|
|
|
+ View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
|
|
|
+ | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
|
|
|
+ | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
|
|
|
+ | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
|
|
|
|
+ | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
|
|
|
|
+ | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
|
|
|
|
+ }
|
|
|
|
|
|
for(int i=0;i<singleton_count;i++) {
|
|
for(int i=0;i<singleton_count;i++) {
|
|
|
|
|
|
@@ -570,6 +596,24 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public void UiChangeListener() {
|
|
|
|
+ final View decorView = getWindow().getDecorView();
|
|
|
|
+ decorView.setOnSystemUiVisibilityChangeListener (new View.OnSystemUiVisibilityChangeListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public void onSystemUiVisibilityChange(int visibility) {
|
|
|
|
+ if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {
|
|
|
|
+ decorView.setSystemUiVisibility(
|
|
|
|
+ View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
|
|
|
+ | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
|
|
|
+ | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
|
|
|
+ | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
|
|
|
+ | View.SYSTEM_UI_FLAG_FULLSCREEN
|
|
|
|
+ | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override public void onSensorChanged(SensorEvent event) {
|
|
@Override public void onSensorChanged(SensorEvent event) {
|
|
Display display = ((WindowManager) getSystemService(WINDOW_SERVICE)).getDefaultDisplay();
|
|
Display display = ((WindowManager) getSystemService(WINDOW_SERVICE)).getDefaultDisplay();
|
|
int displayRotation = display.getRotation();
|
|
int displayRotation = display.getRotation();
|