Added support for inset handling on Android 15

This commit is contained in:
Sam Lantinga
2024-12-30 12:23:00 -08:00
parent f3cbd04a81
commit e91c37f4dd
7 changed files with 48 additions and 22 deletions

View File

@@ -6,10 +6,10 @@ def buildWithCMake = project.hasProperty('BUILD_WITH_CMAKE');
android {
namespace "org.libsdl.app"
compileSdkVersion 34
compileSdkVersion 35
defaultConfig {
minSdkVersion 19
targetSdkVersion 34
targetSdkVersion 35
versionCode 1
versionName "1.0"
externalNativeBuild {

View File

@@ -928,6 +928,10 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
if (Build.VERSION.SDK_INT >= 28 /* Android 9 (Pie) */) {
window.getAttributes().layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
}
if (Build.VERSION.SDK_INT >= 30 /* Android 11 (R) */ &&
Build.VERSION.SDK_INT < 35 /* Android 15 */) {
SDLActivity.onNativeInsetsChanged(0, 0, 0, 0);
}
}
} else {
Log.e(TAG, "error handling message, getContext() returned no Activity");