Fixed running on Android 10 and older (thanks @AntTheAlchemist!)

This commit is contained in:
Sam Lantinga 2024-07-24 12:51:51 -07:00
parent c601120883
commit 31730bef1a
1 changed files with 8 additions and 9 deletions

View File

@ -194,16 +194,15 @@ public class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
// Window inset
@Override
public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
Insets combined = insets.getInsets(WindowInsets.Type.statusBars() |
WindowInsets.Type.navigationBars() |
WindowInsets.Type.captionBar() |
if (Build.VERSION.SDK_INT >= 30 /* Android 11 (R) */) {
Insets combined = insets.getInsets(WindowInsets.Type.systemBars() |
WindowInsets.Type.systemGestures() |
WindowInsets.Type.mandatorySystemGestures() |
WindowInsets.Type.tappableElement() |
WindowInsets.Type.displayCutout() |
WindowInsets.Type.systemOverlays());
WindowInsets.Type.displayCutout());
SDLActivity.onNativeInsetsChanged(combined.left, combined.right, combined.top, combined.bottom);
}
// Pass these to any child views in case they need them
return insets;