Ah… This was added to daily build 2398, the first daily build after the last public release. The forums say you are a Starter account, so this is not a feature in the SDK you can use.
Rob
Ah… This was added to daily build 2398, the first daily build after the last public release. The forums say you are a Starter account, so this is not a feature in the SDK you can use.
Rob
Ah! It’s ok.
I’m happy that the feature even exist. I’ll wait till the next public release. :)
I’m using native.setProperty( “androidSystemUiVisibility”, “immersive” ) and it works great.
Make sure to set it first thing on start-up so your setting up your screen dimensions to the immersive resolution and on app resume.
Also since you have no idea if the user has swiped up the status bar and has once again resumed interacting with your app I set immersive mode on every event.phase == “began” touch that isn’t in the vicinity of the top or bottom edge of the screen to hide it.
I’m having a small issue where the native.setActivityIndicator(true) will cause the navigation bar to reappear. I haven’t tried it with immersivesticky, but with immersive, the navigation bar stays. I have a semi fix where the next .lua file will set native.setProperty( “androidSystemUiVisibility”, “immersive” ) again, but it’s still a bit annoying that it pops up every time the Activity Indicator is used.
Does anyone know a better solution?
I’m having a small issue where the native.setActivityIndicator(true) will cause the navigation bar to reappear. I haven’t tried it with immersivesticky, but with immersive, the navigation bar stays. I have a semi fix where the next .lua file will set native.setProperty( “androidSystemUiVisibility”, “immersive” ) again, but it’s still a bit annoying that it pops up every time the Activity Indicator is used.
Does anyone know a better solution?
Hey guys
Where should I add these lines?
In the game scene itself?
You add them where you need them. I know that doesn’t make sense, but bear with me. Do you want to hide the navbar for the entire app? Then put them at the top of your main.lua. If you only want to hide them during your scene, then put them in scene:show() to hide them and turn them back on again in scene:hide().
Rob
Thanks for your answer rob.
So this is how my main.lua first rows look like now and it still not working-
1)display.setStatusBar(display.HiddenStatusBar);
3)native.setProperty( “androidSystemUiVisibility”, “immersiveSticky” )
5)_G.totalWidth = display.contentWidth-(display.screenOriginX*2);
…
Is there any solution for this problem?
(I’m using v2015.2646)
I’d like to add that both immersive modes are bugged when you call native.showAlert() as well.
It probably happens with all the native library APIs that call non openGL objects to the screen too.
It’s really strange that nobody noted it so far, as this feature was included in 4.x version of Android and it’s been part of Corona’s native library since some months ago. If it helps, i’m using 2015.2647 with Android 5.0.2, but I’m pretty sure it happens in all version.
This is a work-around:
local function onComplete(event) if event.action == "clicked" then local i = event.index if i == 1 then timer.performWithDelay(200,function()native.setProperty( "androidSystemUiVisibility", "immersiveSticky");end,1) elseif i == 2 then timer.performWithDelay(200,function()native.setProperty( "androidSystemUiVisibility", "immersiveSticky");end,1) end end end local function testPopup(event) if event.phase == "ended" then local alert = native.showAlert( "Test title", "Test text", { "NO", "YES" }, onComplete ) end end
But like kthompson200 said, it’s annoying because you have to call it again more than once and it changes the size of all the screen. Now imagine it with native.showAlert… some people might use it a lot for configuration/menu/options stuff, even some people could use it for gameplay, and the size of the screen goes back and forth.
Hopefully we get a fix soon.
We’re not aware of any issue with native alerts causing problems with “immersiveSticky” mode, but it’s possible. If you can exhibit this in an easily reproducable example project, please submit a bug report.
That being said, please note that there is an open bug on Google’s end where “immersiveSticky” fails to hide the bottom navigation bar (it’ll show a black bar at the bottom with no controls) when returning/resuming your app from Android’s task manager. That’s definitely a bug on Google’s end and we were not able to find a work-around. This alert issue might be something similar.
https://code.google.com/p/android/issues/detail?id=170752
Take care,
Brent
Hey guys
Where should I add these lines?
In the game scene itself?
You add them where you need them. I know that doesn’t make sense, but bear with me. Do you want to hide the navbar for the entire app? Then put them at the top of your main.lua. If you only want to hide them during your scene, then put them in scene:show() to hide them and turn them back on again in scene:hide().
Rob
Thanks for your answer rob.
So this is how my main.lua first rows look like now and it still not working-
1)display.setStatusBar(display.HiddenStatusBar);
3)native.setProperty( “androidSystemUiVisibility”, “immersiveSticky” )
5)_G.totalWidth = display.contentWidth-(display.screenOriginX*2);
…
Is there any solution for this problem?
(I’m using v2015.2646)
I’d like to add that both immersive modes are bugged when you call native.showAlert() as well.
It probably happens with all the native library APIs that call non openGL objects to the screen too.
It’s really strange that nobody noted it so far, as this feature was included in 4.x version of Android and it’s been part of Corona’s native library since some months ago. If it helps, i’m using 2015.2647 with Android 5.0.2, but I’m pretty sure it happens in all version.
This is a work-around:
local function onComplete(event) if event.action == "clicked" then local i = event.index if i == 1 then timer.performWithDelay(200,function()native.setProperty( "androidSystemUiVisibility", "immersiveSticky");end,1) elseif i == 2 then timer.performWithDelay(200,function()native.setProperty( "androidSystemUiVisibility", "immersiveSticky");end,1) end end end local function testPopup(event) if event.phase == "ended" then local alert = native.showAlert( "Test title", "Test text", { "NO", "YES" }, onComplete ) end end
But like kthompson200 said, it’s annoying because you have to call it again more than once and it changes the size of all the screen. Now imagine it with native.showAlert… some people might use it a lot for configuration/menu/options stuff, even some people could use it for gameplay, and the size of the screen goes back and forth.
Hopefully we get a fix soon.
We’re not aware of any issue with native alerts causing problems with “immersiveSticky” mode, but it’s possible. If you can exhibit this in an easily reproducable example project, please submit a bug report.
That being said, please note that there is an open bug on Google’s end where “immersiveSticky” fails to hide the bottom navigation bar (it’ll show a black bar at the bottom with no controls) when returning/resuming your app from Android’s task manager. That’s definitely a bug on Google’s end and we were not able to find a work-around. This alert issue might be something similar.
https://code.google.com/p/android/issues/detail?id=170752
Take care,
Brent