Hello everyone,
I updated an app to target SDK 36, and something happened that I need to understand.
When the app targeted SDK 35 and we used `<item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>` in the manifest, the app screen occupied the entire display area. You could adjust the layout to prevent the device's navigation bars from overlapping the app's controls.
With the update, I expected this behavior to persist without needing to declare anything in the manifest. However, the app's behavior differed from my expectations.
Below are screenshots from different Android versions:
Android 12 and Android 15 with the manifest declaration:
Android 16 without the manifest declaration:
Here is the manifest declaration:
I updated an app to target SDK 36, and something happened that I need to understand.
When the app targeted SDK 35 and we used `<item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>` in the manifest, the app screen occupied the entire display area. You could adjust the layout to prevent the device's navigation bars from overlapping the app's controls.
With the update, I expected this behavior to persist without needing to declare anything in the manifest. However, the app's behavior differed from my expectations.
Below are screenshots from different Android versions:
Android 12 and Android 15 with the manifest declaration:
Android 16 without the manifest declaration:
Here is the manifest declaration:
Manifesto declaration:
'================ DEFAULT =================
AddManifestText(
<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="36"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
SetApplicationAttribute(android:allowBackup, "false")
SetApplicationAttribute(android:usesCleartextTraffic, "false")
'SetApplicationAttribute(android:theme, "@style/MyAppTheme")
SetApplicationAttribute(android:theme, "@style/LightTheme")
'================ THEMES =================
CreateResource(values, colors.xml,
<resources>
<color name="actionbar">@android:color/transparent</color>
</resources>
)
CreateResource(values, theme.xml,
<resources>
<style name="LightTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:colorPrimary">@color/actionbar</item>
<item name="android:windowActionBarOverlay">true</item>
</style>
</resources>
)
'CreateResource(values, theme.xml,
'<resources>
' <style name="MyAppTheme" parent="Theme.AppCompat.Light.NoActionBar">
' </style>
'
' <style name="LightTheme" parent="Theme.AppCompat.Light">
' <item name="android:actionMenuTextAppearance">@style/LowerCaseMenu</item>
' <item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
' </style>
'
' <style name="LowerCaseMenu" parent="android:TextAppearance.Material.Widget.ActionBar.Menu">
' <item name="android:textAllCaps">false</item>
' </style>
'
' <style name="Theme.Hidden" parent="@android:style/Theme.NoDisplay" />
' <style name="Theme.PlayCore.Transparent" parent="@android:style/Theme.Translucent.NoTitleBar" />
'</resources>
')
[/CÓDIGO]
I noticed an intriguing situation: when rotating the phone to landscape mode and back to portrait mode, the app switched to full-screen behavior.
Thank you in advance for your attention.