diff --git a/src/Core/src/Platform/Android/MauiAppCompatActivity.cs b/src/Core/src/Platform/Android/MauiAppCompatActivity.cs index b35231c3e538..a4132f4a806c 100644 --- a/src/Core/src/Platform/Android/MauiAppCompatActivity.cs +++ b/src/Core/src/Platform/Android/MauiAppCompatActivity.cs @@ -13,6 +13,13 @@ public partial class MauiAppCompatActivity : AppCompatActivity protected override void OnCreate(Bundle? savedInstanceState) { + // https://github.com/dotnet/maui/issues/24742 + // By default we opt out of edge to edge enforcment on Android 35+ + // Must be applied before the DecorView is setup + // We set force to false in case the style has already been explicitly + // applied to disable opting out of edge to edge enforcement + Theme?.ApplyStyle(Resource.Style.OptOutEdgeToEdgeEnforcement, force: false); + if (!AllowFragmentRestore) { // Remove the automatically persisted fragment structure; we don't need them diff --git a/src/Core/src/Platform/Android/Resources/values-v35/styles.xml b/src/Core/src/Platform/Android/Resources/values-v35/styles.xml new file mode 100644 index 000000000000..d0db95cfcf68 --- /dev/null +++ b/src/Core/src/Platform/Android/Resources/values-v35/styles.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/Core/src/Platform/Android/Resources/values/styles.xml b/src/Core/src/Platform/Android/Resources/values/styles.xml index 94d8753a00dd..96ea5013d7c1 100644 --- a/src/Core/src/Platform/Android/Resources/values/styles.xml +++ b/src/Core/src/Platform/Android/Resources/values/styles.xml @@ -1,5 +1,12 @@ + + + + +