Page 1 of 1

Android full screen with buttons always on

Posted: Wed Feb 05, 2020 4:06 pm
by bio1712
Hi everyone

On Android, if I set t.fullscreen = true in love.conf 3 things happen:
1. Safe area disappears
2. The soft buttons disappear
3. The navigation bar disappears

I would like to have only the first and the third ones.
So I've decided to keep t.fullscreen = false, then I've modified SDLActivity.java to hide the navigation bar, but I can't find a way to disable the safe area.

In particular, I would like to switch from this behaviour

Image

to this one.

Image

This issue there is only with Löve 11.3, as with Löve 11.2 I didn't have the safe area.

Thank you

Re: Android full screen with buttons always on

Posted: Thu Feb 13, 2020 5:26 am
by AuahDark
This is caused because LOVE 11.3 fullscreen code conflicts with SDL. I've fixed this in development branch of love-android. If you don't mind recompiling then you can use that branch, but make sure to checkout the stable LOVE submodule repository.

Re: Android full screen with buttons always on

Posted: Thu Feb 13, 2020 1:49 pm
by bio1712
Unfortunatly that doesn't solve my problem.
Even if I call manually setImmersiveMode(true); the screen is still as in the first image.

Re: Android full screen with buttons always on

Posted: Fri Feb 14, 2020 2:17 am
by AuahDark
This trickier than I thought. Unfortunately you'll have to wait until I have new devices with virtual navigation buttons like your phone, since my current phone has dedicated space for navigation buttons.

Re: Android full screen with buttons always on

Posted: Fri Feb 14, 2020 3:33 pm
by bio1712
Why do you think it's a problem with the buttons? Isn't it a problem with the notch?

Re: Android full screen with buttons always on

Posted: Sat Feb 15, 2020 1:49 pm
by AuahDark
It's something have to do with sticky immersive mode if I'm right. LOVE used to have its own "immersive" mode but turns out it causes race condition issue because SDL also has its own immersive mode code, so I removed it.

In 11.2, you should get first image because it always preserve the notch area as non-drawable, whilst in 11.3, the notch area is completely drawable and you have to use love.window.getSafeArea() to query the non-obstructed area.

Re: Android full screen with buttons always on

Posted: Mon Feb 17, 2020 12:29 pm
by bio1712
The issue is with SDLActivity which sets the flags View.SYSTEM_UI_FLAG_LAYOUT_STABLE and View.SYSTEM_UI_FLAG_VISIBLE as soon as the app stats in the method handleMessage(Message msg).

It has nothing to do with the cutout mode, although I think the right one for us is LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES and not LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER as in your GameActivity.java.

In fact, even if I set the flags in the method OnCreate() of GameActivity.java, I still get this screen:
Image

But if I remove the line 637 of SDLActivity

Code: Select all

window.getDecorView().setSystemUiVisibility(flags);
I finally get this screen.
Image

Here is my GameActivity.java: https://pastebin.com/03BpxSp1
(I've only added the method removeSafeArea() and called it)

Re: Android full screen with buttons always on

Posted: Tue Feb 18, 2020 2:46 pm
by AuahDark
That's interesting. Thanks for the heads up.

Anyway looks like I got your issue. Unfortunately it's not possible as immersive mode implies hidden soft buttons. Setting fullscreen always hides notification bar and soft buttons.

In development branch, cutout mode is set to LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES if the game enters fullscreen, and it sets it back to LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER otherwise.

Re: Android full screen with buttons always on

Posted: Thu Feb 20, 2020 11:28 am
by bio1712
I've tried to use your development branch, however, even if I change LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES to LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER, I still get the first image.
Therefore it is definitely a bug.