Android statusbar

Hi,
i’m currently setting up an android version of our game, that was successfully ported from flash to haxe html. I’d like to run it in total fullscreen mode using extension-android-immersive, which worked fine some weeks ago. But now, i always have the statusbar open, which makes it impossible to use the game :confused:


I’m not sure if it broke when my phone got the Android P update or when i started using haxe4.

Any ideas? I tried all a lot of flag combinations for setSystemUiVisibility, but no luck :frowning:

Turns out the extension is not needed, it is already handled in the GameActivity.java. But still, can’t get rid off the status bar :cry:

Try this: https://github.com/openfl/lime/issues/1313

1 Like

Thx @pozirk, this led me to SDLActivity.java which contains setSystemUiVisibility functionality, too. I removed it in SDLActivity.java and now the status bar is gone :smiley:
Not sure if removing is the best solution, what can i do to avoid this? Or does it need to be fixed im lime?

Did some further investments, in SDLActivity.java these lines cause the trouble:

window.addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN); window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);

It is called inside of SDLActivity.java by setWindowStyle(false), with false meaning no fullscreen. Calling it with true causes correct fullscreen handling, the extra handling in GameActivity.java ist not needed then.

Faster fix is adding
Window window = Extension.mainActivity.getWindow(); window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
to updateSystemUI in GameActivity.java. But it seems odd to have similar code twice.

SDLActivity.java is a part of SDL, they suppose to fix it, and Lime should use updated version.
Might take awhile, I guess.

What if we remove this stuff in our code? Perhaps it has a conflict with the SDL handling code?

When i remove updateSystemUI and call setWindowStyle in SDLActivity.java with true, it works perfectly fine.

What if you remove it and do not call setWindowStyle yourself?

I believe that it is called internally when the window style is set to fullscreen (which should be our default)

setWindowStyle(false); is called in SDLActivity.java by default. If i keep it that way, status and navigation bars are shown. I didn’t find any other usage of setWindowStyle.

I’m trying this change:

(I’m not able to test Android from the machine I’m using right now but judging by the SDL code it should call setWindowStyle(true) if we request fullscreen in C++)

Did not work, but i’m not sure if i managed to setup up the lime dev build correctly. Had to install format and hxp. Did rebuild android. Status and navigation bars are visible

I just tested and confirmed that basic samples are working fine in this regard – at least on my Android 6 testing device

I’ll probably need to get a newer device around here to test as well

I confirmed that <window fullscreen="false" /> is forcing the status bars to show and <window fullscreen="true" /> (or leaving it to the default) is hiding the bars entirely

Ok, cool. Looking forward for the next Lime release :slight_smile: