Lime 7.2.1 -> 7.3.0+ status bar changes
Hey!
So, some changes in SDLActivity.java made app look different, if API >= 19. Before, if app is not in fullscreen it hides status bar (top bar with time, battery, etc.) and only leaves action bar (bottom bar with back button, etc.), which makes sense for me, because some devices have no physical buttons. With the latest Lime 7.3.0, without fullscreen, both bars are visible now. Are there any more flexible way to control which bar I want to show?
Thank you!
Had a similar effect. For me it makes the top-bar visible, on one of my test-phones Didnt dive into it and stayed with the older super-stable setup.
This sounds like it might be related this issue, fixed in recent dev SDL: https://bugzilla.libsdl.org/show_bug.cgi?id=4424
They are talking about SDLActivity.java, yes. According to description sounds really similar. I've fixed it for myself simply by commenting out lines 592 to 598 and 1347 to 1352.
@pozirk I don't think this issue should be closed until it's fixed in Lime though?
Well, it's not Lime issue. According to comments in Tw1ddle's link, they've fixed it in SDL, so will be fixed automatically with next update. I have my own fix for now. :) What else?
That makes it a Lime issue too, because Lime bundles SDL. ;)
Patching SDLActivity.java in Lime with this may fix this, though I'm not sure if what @pozirk reported is this exact case or not: https://hg.libsdl.org/SDL/rev/3b1f484500f0
FYI there are more bugs in this area of SDL 2.0.9's Android fullscreen-handling code, such as this: https://bugzilla.libsdl.org/show_bug.cgi?id=4580
What I've posted, fixed my specific problem. If you believe it's something bigger, we can leave it open. :)
Happy to patch our SDLActivity.java (or accept a pull request doing so!) if it looks right after the fix
I went ahead and applied the patch here:
https://github.com/openfl/lime/commit/f702c8958be3453f7128400b2b020416d31e08b9
RE the fullscreen issue, there are some newer commits that are supposed to fix it:
https://github.com/SDL-mirror/SDL/commits/master/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
We could consider moving to a newer SDL dev version entirely? or someone could test a Java-only patch?
Thanks, I think the patch you applied would cover this status bar issue. I've opened #1315 about this other fullscreen issue.
The https://github.com/openfl/lime/commit/f702c8958be3453f7128400b2b020416d31e08b9 patch helped to hide the status bar. However, about half the time after launch, my games would have black/empty regions at the top and/or bottom of the screen where the status bars would have been.
I haven't gotten to the bottom of that, but commenting the lines pozirk mentioned made the issue go away: https://github.com/openfl/lime/blob/fa91dd60398b56ca96ff1d1687061676b7c6b85e/templates/android/template/app/src/main/java/org/libsdl/app/SDLActivity.java#L615-L619
To apply the workaround, I used a template path in my Project.xml to override the copy of SDLActivity.java that lime uses like this:
<template path="android/SDLActivity.java" rename="app/src/main/java/org/libsdl/app/SDLActivity.java" />
Lime 7.5.0, bar still there.
.
Also with 7.7.0 - The bar is always present - Tried the Immersive extension, tried to change the android manifest and all other fixes i could find - no result. The top bar is always present. No fix for this ATM then?
@datee Try to change setWindowStyle(false) to setWindowStyle(true) in SDLActivity.java of lime. The immersive extension is not needed anymore
setWindowStyle appears to be tied to the SDL fullscreen attribute, which should be connected to <window fullscreen="" /> in Lime. Does toggling stage.window.fullscreen = true; or adding <window fullscreen="true" /> to project.xml help?
So <window fullscreen="true" /> hides everything. (lime 7.7.0)
Is there also a way to just hide status bar, but leave action bar?