Search code examples
androidhaxe

Status bar stays visible in immersive mode


i'm working on an Android build of a game written in Haxe. It used to work some time ago, but now the status bar stays visible after entering immersive mode. As you see on the screenshot, the button in the upper right is blocked, an Android menu is shown when you try to touch it. It could be related to an upgrade of my phone to Android Pie.

Android screen shot showing status bar blocking ingame buttons

Im currently using this flags:

decorView.setSystemUiVisibility(
                View.SYSTEM_UI_FLAG_IMMERSIVE
                | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
                | View.SYSTEM_UI_FLAG_FULLSCREEN);

I tried a lot of combinations, without success. The status bar stays visible. Before it was not visible and only appeared, when the user swyped down from the top. That is the behaviour I like to restore.


Solution

  • This was caused by a Lime internal issue. Beside the basic lime setSystemUiVisibility handling, lime uses SDL, which also handles setSystemUiVisibility. But here it is set to not fullscreen, adding some extra flags:

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

    If these flags are switched back, the status bar disappears like intended. I hope this will be fixed soon in lime itself.