Android navigation bar - issues with touch

Hi

Since more and more Android devices come with soft navigation buttons, we wanted to run our games in full screen. So we have used the code from forums:

function resizeViewport() if (system.getInfo("platformName") == "Android") then local androidVersion = string.sub(system.getInfo("platformVersion"), 1, 3) if (androidVersion and tonumber(androidVersion) \>= 4.4) then native.setProperty("androidSystemUiVisibility", "immersiveSticky") elseif (androidVersion) then native.setProperty("androidSystemUiVisibility", "lowProfile") end end end

Just a note to whoever want to use this code:

THIS HAS TO BE RUN AFTER EVERY VIEWPORT CHANGE!

That means, running this function in applicationResume  listener MIGHT NOT BE ENOUGH!

For example, displaying video ads will change your viewport, so you will have to run this after your ad is closed.

But ok, back to the topic.

When user opens the navigation bar and hovers finger over it, the touch goes through it and to the corona layer :frowning: This creates a lot of unpredictable scenarios, especially because we use back button to close some of the panels.

It’s difficult to explain, but thanks to some fiddling users can do few things simultaneously where normally they are not allowed to do that.

I’m wondering if there’s a way to detect that this navigation bar is opened, so we could block all touch.

Thanks

Krystian

Seems like you have to detect the height of those bottom controls and place your content a little bit higher than the bar is positioned. Or to get some foo block layer with a blank tap functionality on it to cover your main content from bubble taps thru the controls.
But the problem is to detect the height of that navi bar. That’s an issue.