Android long height screen wrong content calculations

Hello
I have an app configured with content:
width = 750,
height = 1334

The app in android with high screen does not work well, the calculated device height is wrong.
Also, I see a strange grey area at the bottom, just above the navigation bar.
This bad behavior is relevant to the “androidSystemUiVisibility” and setStatusBar. In other words, the calculated pixelHeight is changing.

Device: POCO X3 Resolution 1080 x 2400 pixels (android version 11)
In most of the “androidSystemUiVisibility” - setStatusBar combinations, the pixelHeight is 2049 or 2270 and not 2400.

I would like to have status and navigation bar visible, as it is a business app, but there is no ideal combination of “androidSystemUiVisibility” - setStatusBar as there is a strange dark area in the bottom and as said the calculated display related attributes are wrong.
Using “immersiveSticky” could be an option, as the bottom dark area is not shown, but then a lot of content properties are not calculated properly and I cannot find the correct safe are on top and bottom of the screen, so to position UI components properly.

On Android devices with not so high screen, there is no issue. Also iOS works fine.

1 Like

I found that setting the “androidSystemUiVisibility” in main and then start building the app (loading composer and navigating to first screen), system did not have the time to recalculate the device related display properties.
Solution:
In main, load composer and navigate to first screen after some time, using a timer.
Working combination:
native.setProperty( “androidSystemUiVisibility”, “immersiveSticky” )
display.setStatusBar( display.DarkTransparentStatusBar )

Issue remaining:
androidSystemUiVisibility LowPrifile and Default show a grey area in the bottom. Does not render properly. Not able to have android navigation and status bar on in this device.

Hello @ftsirigotis, could this be same issue I’m experiencing in screen cropped on moto g(8) power - Corona / Android - Solar2D Game Engine ?

Hi @kumasoft . I have similar grey area in portrait mode. Try this native.setProperty( “androidSystemUiVisibility”, “immersiveSticky” )

Hey!

A bit late response, but I just finished rewriting my screen module that is intended to handle things like this. Please check out this post and let me know if it helps you out:

1 Like

Hello folks, sorry for the late reply. I wanted to say thanks for all the help! Indeed, leveraging

native.setProperty("androidSystemUiVisibility", "immersiveSticky")

solved my issue, and @XeduR sample code was super useful too.

Our game is now live in the Android store! :slight_smile: