Problems with onSystemEvent(event) and immersiveSticky

Hello all,

I do not know if it’s that I’m doing something wrong or if there is any bug, but there is something I do not understand.

In my file.lua on the storyboard I’m loading I have the following code:

[lua]local function onSystemEvent(event)

if (event.type == “applicationStart”) then

    native.setProperty(“androidSystemUIVisibility”, “immersiveSticky”)

    return true

end

if (event.type == “applicationSuspend”) then

    native.setProperty(“androidSystemUIVisibility”, “immersiveSticky”)

    return true

end

if (event.type == “applicationResume”) then

    native.setProperty(“androidSystemUIVisibility”, “immersiveSticky”)

    return true

end

Runtime:addEventListener(“system”, onSystemEvent) [/lua]

With that, allows my application to go to Immersive mode and hides the navigation keys and the status bar. Cool.

But when I go to desktop (press home button):

a) if I press my icon to come back, cool, works fine, immersive mode again (applicationStart moment)

B) if I press the power button and again to be back to my app, cool, works fine, immersive mode again (applicationResume moment)

c) if I press home button and then the task viewer button and choose my application… moooooooock! Application shows a black bar on the bottom where the navigation keys would be if activated (applicationResume moment).

I’ve tried setting up the “applicationSuspend” moment with “immersive” and “immersiveSticky” but same results.

Probably I’m doing something wrong, but maybe is a bug between CoronaSDK and Lollipop.

Please, can someone bring me some light on this?

Thanks a lot. Appreciated.

Best regards (and happy Friday’s coding :))

I can confirm that there’s sometimes some weirdness when resuming apps.

The way I see it, Corona sometimes assumes that the navigation bar is always present. When this happens Corona doesn’t extend the screen to include the area where the navigation bar would have been, resulting in a black rectangle in place of the navigation bar.

@thearcherblog

I think it’s good idea to file a bug report to have this issue investigated further by the Corona team.

Ok, I submitted the bug. Let’s hope to be fixed soon :slight_smile:

Thanks a lot for your reply.

Cheers :slight_smile:

just wanted to say:  me too

same symptoms:  immersive cannot be reestablished for the duration of a session that has been resumed via task list.

if you then task away again (via home, power, task list, etc) and return via icon, immersive restored.

task away again and return via task list, not immersive.  every time, repeat as much as you like.

i’ve tried a couple shot-in-the-dark kludges, like trying to set it back to default first, and/or timer.performWithDelay on it, but nothing seems capable of reestablishing immersive mode if app is resumed via task list.

edit to clarify:  intended to be same as OP’s description - immersiveSticky *ITSELF* is reestablished after a task switch, but the app never *FILLS* it (black bar at bottom, nav bar is indeed immersively hidden).  So, the device reestablishes immersive, but Corona’s view does not.

Hi @thearcherblog,

Can you please post the bug case # if you have it, so we can reference it within this thread?

Thanks,

Brent

I can confirm that there’s sometimes some weirdness when resuming apps.

The way I see it, Corona sometimes assumes that the navigation bar is always present. When this happens Corona doesn’t extend the screen to include the area where the navigation bar would have been, resulting in a black rectangle in place of the navigation bar.

@thearcherblog

I think it’s good idea to file a bug report to have this issue investigated further by the Corona team.

Ok, I submitted the bug. Let’s hope to be fixed soon :slight_smile:

Thanks a lot for your reply.

Cheers :slight_smile:

just wanted to say:  me too

same symptoms:  immersive cannot be reestablished for the duration of a session that has been resumed via task list.

if you then task away again (via home, power, task list, etc) and return via icon, immersive restored.

task away again and return via task list, not immersive.  every time, repeat as much as you like.

i’ve tried a couple shot-in-the-dark kludges, like trying to set it back to default first, and/or timer.performWithDelay on it, but nothing seems capable of reestablishing immersive mode if app is resumed via task list.

edit to clarify:  intended to be same as OP’s description - immersiveSticky *ITSELF* is reestablished after a task switch, but the app never *FILLS* it (black bar at bottom, nav bar is indeed immersively hidden).  So, the device reestablishes immersive, but Corona’s view does not.

Hi @thearcherblog,

Can you please post the bug case # if you have it, so we can reference it within this thread?

Thanks,

Brent

Anything ever happen with this? I am still seeing the same behavior on 2015.2689.  Tried on Nexus 6, and on app resume, the menu bar is always there, covering up a small portion of my app (because I’ve never handled a resize event).

This is a bug with Android and we haven’t found a work around yet.

Rob

Have you figure it out ?

Not that I’m aware of.

I know that one of our guys is trying to see if by going directly into Enterprise, we get get around this and many other issues that we have run into with sticky Immersive. Don’t have an answer on it yet.

What I can tell you is that, this seems like a very poorly implemented feature on Android OS’s end, and the edge cases seem to be endless…

The case number I have from February 2015 is: : (Case 38757)

Still waiting, I guess it’s a complicate case

Anything ever happen with this? I am still seeing the same behavior on 2015.2689.  Tried on Nexus 6, and on app resume, the menu bar is always there, covering up a small portion of my app (because I’ve never handled a resize event).

This is a bug with Android and we haven’t found a work around yet.

Rob

Have you figure it out ?

Not that I’m aware of.

I know that one of our guys is trying to see if by going directly into Enterprise, we get get around this and many other issues that we have run into with sticky Immersive. Don’t have an answer on it yet.

What I can tell you is that, this seems like a very poorly implemented feature on Android OS’s end, and the edge cases seem to be endless…