From 3075810de8fdd005a440345359b623fb074ec41f Mon Sep 17 00:00:00 2001 From: hwsmm <9151706+hwsmm@users.noreply.github.com> Date: Tue, 20 Aug 2024 01:26:58 +0900 Subject: [PATCH] Fix Android safe area --- osu.Framework.Android/AndroidGameActivity.cs | 7 ------- osu.Framework.Android/AndroidGameSurface.cs | 4 ++-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/osu.Framework.Android/AndroidGameActivity.cs b/osu.Framework.Android/AndroidGameActivity.cs index b500a20944..41c69e69b4 100644 --- a/osu.Framework.Android/AndroidGameActivity.cs +++ b/osu.Framework.Android/AndroidGameActivity.cs @@ -1,12 +1,10 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System; using Android.App; using Android.Content; using Android.Content.PM; using Android.OS; -using Android.Views; using ManagedBass; using Org.Libsdl.App; using osu.Framework.Extensions.ObjectExtensions; @@ -55,11 +53,6 @@ protected override void OnCreate(Bundle? savedInstanceState) System.Environment.CurrentDirectory = System.Environment.GetFolderPath(System.Environment.SpecialFolder.UserProfile); base.OnCreate(savedInstanceState); - - if (OperatingSystem.IsAndroidVersionAtLeast(28)) - { - Window.AsNonNull().Attributes.AsNonNull().LayoutInDisplayCutoutMode = LayoutInDisplayCutoutMode.ShortEdges; - } } protected override void OnStop() diff --git a/osu.Framework.Android/AndroidGameSurface.cs b/osu.Framework.Android/AndroidGameSurface.cs index 69f45456da..8f913d1b74 100644 --- a/osu.Framework.Android/AndroidGameSurface.cs +++ b/osu.Framework.Android/AndroidGameSurface.cs @@ -58,10 +58,10 @@ public override void HandleResume() isSurfaceReady = true; } - public override WindowInsets? OnApplyWindowInsets(WindowInsets? insets) + public override WindowInsets? OnApplyWindowInsets(View? view, WindowInsets? insets) { updateSafeArea(insets); - return base.OnApplyWindowInsets(insets); + return base.OnApplyWindowInsets(view, insets); } ///