mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-23 15:52:55 +01:00
Android: enable fullscreen mode, raise min SDK
Fullscreen mode (sticky immersive) is enabled. The minimum SDK version was raised to 19 (4.4.2 KitKat, which is more than old enough) from 16 to enable this. Additonally, deprecation compiler warnings were enabled.
This commit is contained in:
@@ -6,7 +6,7 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
applicationId 'website.openrct2'
|
||||
minSdkVersion 16
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 29
|
||||
|
||||
versionCode 2
|
||||
@@ -96,4 +96,12 @@ dependencies {
|
||||
implementation 'com.google.android.gms:play-services-analytics:17.0.0'
|
||||
}
|
||||
|
||||
allprojects {
|
||||
gradle.projectsEvaluated {
|
||||
tasks.withType(JavaCompile) {
|
||||
options.compilerArgs << "-Xlint:deprecation"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package website.openrct2;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import org.libsdl.app.SDLActivity;
|
||||
|
||||
public class GameActivity extends SDLActivity {
|
||||
@@ -22,6 +24,23 @@ public class GameActivity extends SDLActivity {
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWindowFocusChanged(boolean hasFocus) {
|
||||
super.onWindowFocusChanged(hasFocus);
|
||||
|
||||
// Set app to fullscreen mode
|
||||
if (hasFocus) {
|
||||
getWindow().getDecorView().setSystemUiVisibility(
|
||||
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
||||
| View.SYSTEM_UI_FLAG_FULLSCREEN
|
||||
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
protected String[] getArguments() {
|
||||
if (getIntent().hasExtra("commandLineArgs")) {
|
||||
return getIntent().getStringArrayExtra("commandLineArgs");
|
||||
|
||||
Reference in New Issue
Block a user