Android full screen with buttons always on

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
bio1712
Citizen
Posts: 72
Joined: Wed Aug 19, 2015 4:13 pm
Location: Italy

Android full screen with buttons always on

Post by bio1712 » Wed Feb 05, 2020 4:06 pm

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

User avatar
AuahDark
Prole
Posts: 38
Joined: Mon Oct 23, 2017 2:34 pm
Location: Indonesia
Contact:

Re: Android full screen with buttons always on

Post by AuahDark » Thu Feb 13, 2020 5:26 am

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.
Profile. I don't always online in forum, so Discord is preferred.

bio1712
Citizen
Posts: 72
Joined: Wed Aug 19, 2015 4:13 pm
Location: Italy

Re: Android full screen with buttons always on

Post by bio1712 » Thu Feb 13, 2020 1:49 pm

Unfortunatly that doesn't solve my problem.
Even if I call manually setImmersiveMode(true); the screen is still as in the first image.

User avatar
AuahDark
Prole
Posts: 38
Joined: Mon Oct 23, 2017 2:34 pm
Location: Indonesia
Contact:

Re: Android full screen with buttons always on

Post by AuahDark » Fri Feb 14, 2020 2:17 am

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.
Profile. I don't always online in forum, so Discord is preferred.

bio1712
Citizen
Posts: 72
Joined: Wed Aug 19, 2015 4:13 pm
Location: Italy

Re: Android full screen with buttons always on

Post by bio1712 » Fri Feb 14, 2020 3:33 pm

Why do you think it's a problem with the buttons? Isn't it a problem with the notch?

User avatar
AuahDark
Prole
Posts: 38
Joined: Mon Oct 23, 2017 2:34 pm
Location: Indonesia
Contact:

Re: Android full screen with buttons always on

Post by AuahDark » Sat Feb 15, 2020 1:49 pm

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.
Profile. I don't always online in forum, so Discord is preferred.

bio1712
Citizen
Posts: 72
Joined: Wed Aug 19, 2015 4:13 pm
Location: Italy

Re: Android full screen with buttons always on

Post by bio1712 » Mon Feb 17, 2020 12:29 pm

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)

User avatar
AuahDark
Prole
Posts: 38
Joined: Mon Oct 23, 2017 2:34 pm
Location: Indonesia
Contact:

Re: Android full screen with buttons always on

Post by AuahDark » Tue Feb 18, 2020 2:46 pm

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.
Profile. I don't always online in forum, so Discord is preferred.

bio1712
Citizen
Posts: 72
Joined: Wed Aug 19, 2015 4:13 pm
Location: Italy

Re: Android full screen with buttons always on

Post by bio1712 » Thu Feb 20, 2020 11:28 am

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests