Remove superfluous check for minimum Android SDK.

(cherry picked from commit 2f225bf2c5)
This commit is contained in:
Marcel Admiraal 2022-04-22 17:54:50 +02:00 committed by Rémi Verschelde
parent 81bbde5b9f
commit 23b649b673
1 changed files with 16 additions and 21 deletions

View File

@ -629,7 +629,6 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC
translucent = true; translucent = true;
} else if (command_line[i].equals("--use_immersive")) { } else if (command_line[i].equals("--use_immersive")) {
use_immersive = true; use_immersive = true;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { // check if the application runs on an android 4.4+
window.getDecorView().setSystemUiVisibility( window.getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
@ -637,9 +636,7 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | // hide nav bar View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | // hide nav bar
View.SYSTEM_UI_FLAG_FULLSCREEN | // hide status bar View.SYSTEM_UI_FLAG_FULLSCREEN | // hide status bar
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
UiChangeListener(); 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")) {
@ -825,7 +822,7 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC
mSensorManager.registerListener(this, mMagnetometer, SensorManager.SENSOR_DELAY_GAME); mSensorManager.registerListener(this, mMagnetometer, SensorManager.SENSOR_DELAY_GAME);
mSensorManager.registerListener(this, mGyroscope, SensorManager.SENSOR_DELAY_GAME); mSensorManager.registerListener(this, mGyroscope, SensorManager.SENSOR_DELAY_GAME);
if (use_immersive && Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { // check if the application runs on an android 4.4+ if (use_immersive) {
Window window = getActivity().getWindow(); Window window = getActivity().getWindow();
window.getDecorView().setSystemUiVisibility( window.getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
@ -848,7 +845,6 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC
final View decorView = getActivity().getWindow().getDecorView(); final View decorView = getActivity().getWindow().getDecorView();
decorView.setOnSystemUiVisibilityChangeListener(visibility -> { decorView.setOnSystemUiVisibilityChangeListener(visibility -> {
if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) { if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
decorView.setSystemUiVisibility( decorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
@ -857,7 +853,6 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC
View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_FULLSCREEN |
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
} }
}
}); });
} }