Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Detecting Android Navigation Bar Setting

Author
Message
Kevin Cross
20
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 20th Dec 2019 10:55 Edited at: 20th Dec 2019 11:19
Is there a way to detect how a user has their navigation bar at the bottom set? I.e. fixed, auto-hide, gestures?

If they're not fixed in place the AppGameKit app is offset and shifted down in the screen.

I know there's ImmersiveMode which may remove the bar for everyone when the app is open (not tested yet) but wondering if there's a way to get the app to redraw to the full screen regardless of how they have their navigation bar set.

Having AppGameKit automatically handle this for us would be better than introducing new commands to detect how the bar is set though
OryUI - A WIP AGK2 UI Framework
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 20th Dec 2019 11:23 Edited at: 20th Dec 2019 11:25
Hi Kevin

I use setimmersivemode() and then you have to wait a little time as the navigation bar slides off the screen (its not immediate on some devices) then you can get the devicewidth() and height() and set the resolution to use the full screen. Or you can just setdisplayaspect(-1) after removing the bar. Without doing this you end up with black bars exactly like you said even if the bar autohides.

I have a function that checks for devicewidth or height changes (this is useful on windows too so you can resize windows contents if the window is made bigger/smaller.) I use the same function on android to use the whole screen after the bar has slid away.

Ive not found a way to detect how the bar is set by the user but if you keep setting the immersive mode on resume and at the start then you get full screen access
Kevin Cross
20
Years of Service
User Offline
Joined: 15th Nov 2003
Location: London, UK
Posted: 20th Dec 2019 21:36
Thank you Bengismo. I'll check out ImmersiveMode and thanks for the tip about running when the app is resumed. I will also check whether or not I'm using SetDisplayAspect(-1) I know its at the top of my code but might only be filtered for certains platforms.

I've not tested it but I get a lot of feedback from users on the new larger iOS device that they have black bars at the top and bottom. Maybe the above 2 commands will sort that out too. On most devices it first to the screen. I use percentages for positioning and sizing so found it strange that there'd be borders on some devices/resolutions
OryUI - A WIP AGK2 UI Framework

Login to post a reply

Server time is: 2024-03-29 08:06:18
Your offset time is: 2024-03-29 08:06:18