• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - Code Android 12/Pixel 6 - How do I prevent the top bar to appear when I swipe (top/left/right edge of the screen)?

Flo

Member
Hi guys,

I used to work with a Note 8 and it had the good old three buttons at the bottom of the screen.
Now I switched to a Pixel 6 with Android 12 and I just realized that I can swipe my fingers on the screen edge to Go Back.

It actually doesn't go back to anything or even close down the game but it prevents my character from moving (I use swipe to move) and displays an ugly arrow.

Is there any code that I should add to my game to disable this function?

Note: I'm still using the 1.4 mouse/touch code, I haven't digged into the new GMS2 Gestures Inputs yet but I don't think it will solve anything regarding this 'overlay' gesture that I want to disable as it's part of Android.

Thanks!
 
Last edited:

gkri

Member
With a quick search I found that you can disable those gestures via the settings app : System -> Gestures (source)

PS: I cannot confirm it, because I do not have that device...
 

Flo

Member
Thank you but I don't think letting the user do that by himself is the good approach.
What I'm looking for is a function kind of like keeping the screen awake with "os_powersave_enable(false);" for example.
 

gkri

Member
Thank you but I don't think letting the user do that by himself is the good approach.
What I'm looking for is a function kind of like keeping the screen awake with "os_powersave_enable(false);" for example.
This is very specific feature for a very specific group of devices. I do not think it is doable, but IF it is doable, you might have a chance to learn how at xda developers forum.
 

Flo

Member
Thanks! I guess I'll have to write an Android extension because I don't find anything related to this in the manual. Something I've never done before, that will be a good way to start then!
 
Last edited:

Flo

Member
Actually I found out that the Go Back arrows only appear once the top bar is displayed.
So basically:
1. I swipe on the screen edge: My character moves but the top bar also appears.
2. I swipe again on the screen edge WHILE the top bar is still displayed: My character doesn't move and Go Back arrows are triggered instead.
If I wait for the top bar to disappear, I go back to step 1.

So in the end, my request should be:
How do I make the top bar not being triggered no matter where I swipe on the screen?
I've corrected my summary.
 
So in the end, my request should be:
How do I make the top bar not being triggered no matter where I swipe on the screen?
I've corrected my summary.
Is it necessary to swipe in the problem area? Locking core phone functionality isn't typically smiled upon by OS/app stores.
 

Flo

Member
Well this is a vertical shooter so I can't really prevent the player to go on the screen edges to avoid an enemy for example, that would be bad gameplay wise.
Also, he could still swipe on the edge and trigger the top bar and later on, the Go Back arrows.
It seems that from what I quickly read on the Android SDK documentation, we can hide the status bar but it's not clear if we can keep it hidden.
OR
back to my first question, there might be a way to disable the Go Back arrows because in the end, the top status bar is not really an issue, screen left and right edges are.
 
Last edited:
Top