lime icon indicating copy to clipboard operation
lime copied to clipboard

Lime 7.2.1 -> 7.3.0+ status bar changes

Open pozirk opened this issue 6 years ago • 17 comments

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!

pozirk avatar Apr 26 '19 02:04 pozirk

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.

GregorHaag avatar Apr 28 '19 08:04 GregorHaag

This sounds like it might be related this issue, fixed in recent dev SDL: https://bugzilla.libsdl.org/show_bug.cgi?id=4424

Tw1ddle avatar May 05 '19 18:05 Tw1ddle

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 avatar May 05 '19 23:05 pozirk

@pozirk I don't think this issue should be closed until it's fixed in Lime though?

Gama11 avatar May 06 '19 07:05 Gama11

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?

pozirk avatar May 06 '19 15:05 pozirk

That makes it a Lime issue too, because Lime bundles SDL. ;)

Gama11 avatar May 06 '19 15:05 Gama11

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

Tw1ddle avatar May 06 '19 15:05 Tw1ddle

What I've posted, fixed my specific problem. If you believe it's something bigger, we can leave it open. :)

pozirk avatar May 06 '19 15:05 pozirk

Happy to patch our SDLActivity.java (or accept a pull request doing so!) if it looks right after the fix

jgranick avatar May 07 '19 18:05 jgranick

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?

jgranick avatar May 07 '19 19:05 jgranick

Thanks, I think the patch you applied would cover this status bar issue. I've opened #1315 about this other fullscreen issue.

Tw1ddle avatar May 08 '19 02:05 Tw1ddle

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" />

Tw1ddle avatar May 13 '19 01:05 Tw1ddle

Lime 7.5.0, bar still there. solitaire_topbar .

pozirk avatar Jun 04 '19 01:06 pozirk

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 avatar Feb 03 '20 19:02 datee

@datee Try to change setWindowStyle(false) to setWindowStyle(true) in SDLActivity.java of lime. The immersive extension is not needed anymore

PlutoniumBytes avatar Feb 17 '20 07:02 PlutoniumBytes

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?

jgranick avatar Feb 17 '20 18:02 jgranick

So <window fullscreen="true" /> hides everything. (lime 7.7.0) Is there also a way to just hide status bar, but leave action bar?

pozirk avatar Mar 21 '20 00:03 pozirk