Wonderful!
Iām really curious because no matter what I tried in config, it doesnāt seem to workā¦
Wonderful!
Iām really curious because no matter what I tried in config, it doesnāt seem to workā¦
I do believe the solution is active, not passive.
i.e You canāt just set some values and forget it.Ā Ā You need to actively detect when the on-screen controls are shown and hidden, then adjust.
Iāll confirm or debunk this recollection when I can.
Yes, what I tried (among other) was to detect the resolution change with onResize event and change all the globals about the content areas etc. Then redraw the whole scene. But it didnāt work. So, I guessed it was a good idea to first ask whether others are indeed achieving this (100% fullscreen) or it is a Corona limitationā¦
So far, my Nexus is a brick.Ā I am still recharging with the hope it will wake up.
Till then, the best I can do is share my initial test:
Ā
https://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2018/05/fullScreenImmersive.zip
If Iām right, this should re-apply āimmersiveā when you are finished with the buttons, but I may have made a mistake.
Iāll know more if I ever get to test.
OK, that is not quite right.Ā Ā
My device just woke up and this solution is not quite right.Ā Please hold a few.
This is starting to feel like a bug.
Iāve tried some things and I keep getting this black bar at the bottom that covers all content.Ā The aspect ratio is right, but Corona is simply covered.
I did notice, when using āimmersiveStickyā I get these results:
Updated code:
https://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2018/05/fullScreenImmersive.zip
This should work for all devices (itās what I use)
local function onResize( event ) if \_isAndroid then if (system.getInfo("androidApiLevel") or 0) \>= 19 then native.setProperty("androidSystemUiVisibility", "immersiveSticky") else native.setProperty("androidSystemUiVisibility", "lowProfile") end end --recalculate our new screen constants \_originX, \_originY = display.screenOriginX, display.screenOriginY \_W, \_H = display.actualContentWidth, display.actualContentHeight \_centreX, \_centreY = originX + \_W/2, \_originY +\_H/2 --move the UI if isDisplayObject(uiTopButtons) then uiTopButtons.y = \_originY end if isDisplayObject(uiBottomButtons) then uiBottomButtons.y = \_originY + \_H end end
@roaminggamer, your issue:Ā BBABFRFTLRI (black bar at bottom following resume from task list restoring immersive) has been a bug since day one of immersive:Ā Ā https://forums.coronalabs.com/topic/53170-immersivesticky-and-displayscreenoriginx/
ā¦but, Iām not sure thatās the OPās issue.Ā having āblack barsā at BOTH top and bottom sounds like just not properly responding to the resize event, and a letterbox setup with yAlign=ācenterā.Ā fe, something created to exactly fill the screen PRE-immersive, wonāt fill the screen POST-immersive, unless you specifically do something to change it (or use zoomStretch) because screen dimensions (obviously?) CHANGE following immersive.Ā also, fwiw, yAlign=ātopā can be slightly more intuitive to use when planning for immersive.
This is what I get with @roaminggamerās github code on a LG G6 (soft navigation buttons, Android 7). Same black bars on top and bottom as with my (dozens) variations of code. Do you guys get a full screen immersive with the same code?
You are right. The problem is that the onResize() event seems to be never fired get in my code. I have also tried SGSās version, with same results.
Are you sure onResize() is actually getting called?Ā Did you declare it as Runtime and put it into main.lua?
Next thing to try is to delay my code by a few seconds and see if it is a timing issue - screen metrics checking too fast and soft bar is still on screen.
All I can say is this works for me black bar free on everything from a tiny S3 to an S9 in max resolution. FWIW, I use xAlign and yAlign of center.
BTW, Edās code works fine for me.
Finally I found out that the issue I had was related to the mobile OS. Thanks for your help!
Just to return something to the community: I think that it is way better to separate the immersive setter from the onResize() listener.
The onResize event is triggered both after a resume event and after a set immersive command. So after a resume event you get 2 runs of onResize (this only happens on device, not on simulator, test it with some onscreen prints etc). So, I ended up abandoning the onResize and handling the immersion, resize check and redraw solely on the appstart and resume events. Now, on resume the scene doesnāt need to be redrawn at all, compared to 2 consecutive and redudant redraws when using the onResize.