Android Question layout underneath action bar. B4A 14, android 36

John Leeson

Member
Licensed User
Longtime User
Hi,

Probably very obvious but in my B4XPages app, after downloading B4A 14 and updating to target 36, all the layouts are now underneath the action bar (not the status bar), so text / buttons etc are hidden.

I've only been able to find posts about the colour of the action bar - from what I can see, the layout should just have worked in B4X pages?
 

Brian Dean

Well-Known Member
Licensed User
Longtime User
What you are seeing is the enforced edge-to-edge layout scheme introduced by Google with sdk 36. Erel explains this in this post where he also shows one way to deal with the change.
 
Upvote 0

John Leeson

Member
Licensed User
Longtime User
Thank you for your reply. I read that page, all my views are on a panel.
The way to deal with this change is to add a "root" panel that is positioned in the content area and add any layout that shouldn't be covered by the non-app elements to this panel.

And it specifically say that in B4XPages, no changes are required:

Apologies if I'm misreading it, I assume I must be, but it's not clear to me how to fix it :)
In B4XPages, each page is made of a panel and this panel is resized based on the content area, so no changes are needed.
 
Upvote 0

Brian Dean

Well-Known Member
Licensed User
Longtime User
And it specifically say that in B4XPages, no changes are required
Yes - you are right. But it is hard to imagine that the problem you describe is not connected with edge-to-edge in some way. Unfortunately I very rarely use B4XPages so have no experience to offer. I can only suggest that you examine your code carefully for anything unorthodox. Does your app also extend beneath the navigation bar at the bottom of the screen?
 
Upvote 0

John Leeson

Member
Licensed User
Longtime User
on the physical device I have here, android 14, I have a client using a brand new device (not sure he actual version). if I set #EdgeToEdgeOldDevices: True on my device, we see the same issue.

"Does your app also extend beneath the navigation bar at the bottom of the screen?" - no.
 
Upvote 0

teddybear

Well-Known Member
Licensed User
Try creating a new project to see if the result is different.
 
Last edited:
Upvote 0

Brian Dean

Well-Known Member
Licensed User
Longtime User
If I set #EdgeToEdgeOldDevices: True on my device, we see the same issue.
Doesn't this confirm that there is something wrong with your page setup? Perhaps you should show your B4X_PageCreated sub at least. It does sound like you are adding a view outside of the B4X-Page root.
 
Upvote 0

John Leeson

Member
Licensed User
Longtime User
Good morning. I partly solved it (fullscreen = false 🤦‍♂️ ), but..

I have tried the example here and the action bar is 'double height' (or, is it stacking 2 action bars)? I have made no changes to the example, but I see the same in my app, see attached images, so the example in the link, is an example project :)
 

Attachments

  • 1789288907672.png
    1789288907672.png
    6.3 KB · Views: 59
  • 1789288944949.png
    1789288944949.png
    3.2 KB · Views: 62
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Is it possible that you are seeing the OS statusbar + the B4XPages actionBar?
 
Upvote 0

teddybear

Well-Known Member
Licensed User
I have tried the example here and the action bar is 'double height' (or, is it stacking 2 action bars)? I have made no changes to the example, but I see the same in my app, see attached images, so the example in the link, is an example project :)
Did you try this?
 
Upvote 0

John Leeson

Member
Licensed User
Longtime User
I have managed to test it on a new device and it's OK, so it seems like it's related to the fact I'm on an older device (Galaxy A53, android 14)
 
Upvote 0

John Leeson

Member
Licensed User
Longtime User
Try adding #IncludeTitle: False?
then the title bar and the extra bar both diappear (status bar still visible). Essentially, the behaviour is what you would expect, but there's an extra bar.

I've also tried your example on an older android device (android 11) at that is exactly the same.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
As "edge2edge" is a new thing, you could test for the OS version and change both target sdk in manifest and layout...

I recall seeing such snippet around the forum
 
Upvote 0

Cliff McKibbin

Member
Licensed User
Longtime User
You might want to make sure you are not positioning the panel using 'root.top' in any way.
I had been positioning my top fields using root.top+10 and the effect was to push the top fields down about the same as your panel appears to be pushed down.
I eliminated those commands for the top field and now rely on the position it is in as defined on the layout screen.

B4X:
    ' position the views
'    lbCat.Top=Root.Top
    lbCat.Left=Root.Left+10
    imvVoice.Top=lbCat.Top
    imvVoice.Left=Root.Width-imvVoice.Width-10
    lbEId.Top=lbCat.Top
    lbEId.Left=imvVoice.Left-lbEId.Width-10

You may be doing something like: panel1.top=root.top+ label1.height+10. This would definitely push the panel down to where it is shown.
For the automatic edge handling to work correctly, you can't use root.top at all.

Good luck, Cliff
 
Upvote 0
Top