Legacy GM Android: Disable UI

Dagoba

Member
Hello!

I am making a game to Android, and you need to tap near the top corner of your phone (tapping objects).
This will make the UI visible, where the clock and notifications are.
Is there a workaround to disable this during the game?
It quite makes the gaming difficult because you will fail in the game if the UI becomes visible and you misclick due to it.

I tried to use these scripts:

display_set_ui_visibility(1024); // and 4096 also

But it doesn't affect the top UI, and I want to make it invisible, not visible.

Thanks in advance!
 
Last edited:
I'm not sure if its possible to disable the android UI. Most devices i've used require you to drag down from the top of the screen to show the UI so the problem may not be as bad as you think. I had a quick look online and found something you can put in your androidmanifest.xml file that may help.
Code:
<activity android:name=".Activity"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.NoTitleBar">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>
And this -
Code:
View decorView = getWindow().getDecorView();
// Hide both the navigation bar and the status bar.
// SYSTEM_UI_FLAG_FULLSCREEN is only available on Android 4.1 and higher, but as
// a general rule, you should design your app to hide the status bar whenever you
// hide the navigation bar.
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
              | View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
I'm not sure if this is what you're after though, i've never messed around with this stuff.
Here are the sites where I found this info-
https://stackoverflow.com/questions/17802574/hide-the-top-menu-bar-in-my-android-device-tablet
https://developer.android.com/training/system-ui/navigation.html

Have you considered just changing the position of where you tap the screen?
 
Top