Android Question Full screen with SDK 36 doesn't work.

Cleidson

Member
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 11.png


Android 16 without the manifest declaration:

Android 16.jpg


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.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
 
Upvote 0

Cleidson

Member
Erel,
Thanks for your attention. Please excuse my ignorance, but I just wanted to clarify one thing: Has the edge-to-edge requirement already been addressed in the new version of B4X?
If so, I read the guidance about modifying the status bar color programmatically on each page. Would there be any issue with doing it directly via the manifest? Here is a declaration I’m testing that has been working well.

Manifesto:
'================ 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")
'================ THEMES =================

CreateResource(values, theme.xml,
<resources>   
    <style name="MyAppTheme" parent="Theme.AppCompat.Light.NoActionBar">
         <!-- Define a cor de fundo da janela como o azul do seu cabeçalho -->
        <item name="android:windowBackground">#003566</item>       
        
        <!-- Torna a StatusBar transparente -->
        <item name="android:statusBarColor">@android:color/transparent</item>       
        
        <!-- Ícones brancos no topo para fundo escuro -->
        <item name="android:windowLightStatusBar">false</item>
    </style>
    <style name="Theme.Hidden" parent="@android:style/Theme.NoDisplay"/>
    <style name="Theme.PlayCore.Transparent" parent="@android:style/Theme.Translucent.NoTitleBar"/>
</resources>
)
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Has the edge-to-edge requirement already been addressed in the new version of B4X?
You can properly handle the E2E requirement with B4A v13.7. If using B4XPages then you don't need to do anything. If not then you need to follow the instructions here: https://www.b4x.com/android/forum/threads/b4a-v13-7-beta-targetsdkversion-36-edge-to-edge.171685/

If so, I read the guidance about modifying the status bar color programmatically on each page. Would there be any issue with doing it directly via the manifest? Here is a declaration I’m testing that has been working well.
I'm not sure what you are referring to, however you can change the status bar color from the manifest.
 
Upvote 0
Top