Android Question B4A v13.4 still forcing Edge-to-Edge

Cliff McKibbin

Member
Licensed User
Longtime User
I have installed v13.4 with no problems but the Edge-to-Edge enforcement is still in effect.

I think it may be my legacy Manifest 'light theme' which you can see in the manifest code below:

B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="35"/>
<supports-screens android:largeScreens="true" 
    android:normalScreens="true" 
    android:smallScreens="true" 
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.DarkTheme)
'End of default text.
' added 12/25/18 per article as way to handle permission on older androids
'AddManifestText(
'<uses-permission
'  android:name="android.permission.WRITE_EXTERNAL_STORAGE" />)
' dropped the version specific on 5/26/20 because it wouldn't load to play store  
'  android:maxSdkVersion="19" />
'')
AddApplicationText(
  <provider
  android:name="android.support.v4.content.FileProvider"
  android:authorities="$PACKAGE$.provider"
  android:exported="false"
  android:grantUriPermissions="true">
  <meta-data
  android:name="android.support.FILE_PROVIDER_PATHS"
  android:resource="@xml/provider_paths"/>
  </provider>
)
CreateResource(xml, provider_paths,
   <files-path name="name" path="shared" />
)
' CreateResourceFromFile(Macro, Themes.LightTheme)
SetApplicationAttribute(android:theme, "@style/LightTheme")
  CreateResource(values, colors.xml,
 <resources>
   <color name="actionbar">#ffCECCE7</color>
   <color name="statusbar">#ff96A3A3</color>
   <color name="textColorPrimary">#ff30323E</color>
   <color name="navigationBar">#ff006db3</color>
  </resources>
 )
CreateResource(values-v20, theme.xml,
<resources>
    <style name="LightTheme" parent="@android:style/Theme.Material.Light">
        <item name="android:colorPrimary">@color/actionbar</item>
        <item name="android:colorPrimaryDark">@color/statusbar</item>
        <item name="android:textColorPrimary">@color/textColorPrimary</item>
        <item name="android:navigationBarColor">@color/navigationBar</item>
    </style>
</resources>
)
CreateResource(values-v14, theme.xml,
<resources>
    <style name="LightTheme" parent="@android:style/Theme.Holo.Light">
       <item name="android:actionBarStyle">@style/CustomActionBarStyle</item>
    </style>
   <style name="CustomActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
       <item name="android:background">@color/actionbar</item>
   </style>
</resources>
)
' Google Firebase stuff added 4/16/20 cwm
'CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
'CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
'CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications)
'CreateResourceFromFile(Macro, FirebaseAnalytics.FirebaseAnalytics)
'CreateResourceFromFile(Macro, FirebaseAdMob.FirebaseAds)
'CreateResourceFromFile(Macro, FirebaseAuth.FirebaseAuth)
' Google Play Billing added 4/23/20 cwm  This is from b4a 'Billing' Ex.
CreateResourceFromFile(Macro, GooglePlayBilling.GooglePlayBilling)

I tried taking our the legacy portion and replacing it with the more simple:
CreateResourceFromFile(Macro, Themes.LightTheme) suggested in one of the forum posts.
That entry commented out above.

This resulted in a compile error as shown:

B4X:
B4A Version: 13.40
Parsing code.    (0.09s)
    Java Version: 19
Building folders structure.    (0.19s)
Running custom action.    (0.06s)
Compiling code.    (0.08s)
Compiling layouts code.    (0.02s)
Organizing libraries.    (0.06s)
    (AndroidX SDK)
Compiling resources    (1.41s)
Linking resources    Error
res\values-v14\theme.xml:7: error: resource color/actionbar (aka b4a.RateMyShows:color/actionbar) not found.
res\values-v14\theme.xml:7: error: resource color/actionbar (aka b4a.RateMyShows:color/actionbar) not found.
res\values-v20\theme.xml:4: error: resource color/actionbar (aka b4a.RateMyShows:color/actionbar) not found.
res\values-v20\theme.xml:5: error: resource color/statusbar (aka b4a.RateMyShows:color/statusbar) not found.
res\values-v20\theme.xml:6: error: resource color/textColorPrimary (aka b4a.RateMyShows:color/textColorPrimary) not found.
res\values-v20\theme.xml:7: error: resource color/navigationBar (aka b4a.RateMyShows:color/navigationBar) not found.
res\values-v20\theme.xml:4: error: resource color/actionbar (aka b4a.RateMyShows:color/actionbar) not found.
res\values-v20\theme.xml:5: error: resource color/statusbar (aka b4a.RateMyShows:color/statusbar) not found.
res\values-v20\theme.xml:6: error: resource color/textColorPrimary (aka b4a.RateMyShows:color/textColorPrimary) not found.
res\values-v20\theme.xml:7: error: resource color/navigationBar (aka b4a.RateMyShows:color/navigationBar) not found.
error: failed linking references.

Apparently, my legacy color names are not recognized by the new macro for lighttheme.

I could go through each of my apps and add the dummy panels at the top and bottom of each 'page', but wondered if there was a simple fix to this.

Thanks, Cliff McKibbin
 

Cliff McKibbin

Member
Licensed User
Longtime User
That worked. I think I had seen that 'line' and tried but put it in the wrong spot and it didn't compile.
Thanks, as always Erel.
 
Upvote 0

Tomas Petrus

Active Member
Licensed User
Longtime User
I'm happy to release a new beta version of B4A. The prepackaged Android SDK has been updated and is based on the current latest versions of all resources and Android SDK 36.
The handling of SDK resources was improved.

The built-in themes were updated with the new edge-to-edge feature disabled by default (https://www.b4x.com/android/forum/t...t-of-edge-to-edge-enforcement.167109/#content).

What does it mean exactly for aps made for sdk35 with described changes to opt out edge-to-edge implemented ?
Leave manifest as it is or reverse it back to pre 35 ?

I don’t have android 16… and have already report from client that App that has edge to edge opted out in sdk35 version now builded in new ide for sdk36 is broken that meens that esge to edge is not opted out on android 16. Please help.

manifest:
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="36"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:launchMode="singleInstance"
    android:anyDensity="true"/>)

'SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:icon, "@mipmap/ic_launcher")
CreateResource(mipmap-anydpi-v26, ic_launcher.xml,
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/background"/>
<foreground android:drawable="@mipmap/foreground"/>
</adaptive-icon>
)

SetApplicationAttribute(android:label, "$LABEL$")
'CreateResourceFromFile(Macro, Themes.LightTheme)'opting out edge-to-edge
'End of default text.

''opting out edge-to-edge
SetApplicationAttribute(android:theme, "@style/LightTheme")
CreateResource(values, theme.xml,
<resources>
    <style name="LightTheme" parent="@android:style/Theme.Material.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>
</resources>
)
 
Last edited:
Upvote 0
Top