Fullscreen android?

Does anyone know how to remove the navigation bar from the bottom of the screen in android?

I’ve tried some of the suggestions setting values as per this topic but it’s not working: Run application fullscreen - SOLVED

I’m using of0.11 for android

There’s an article on turning it off for your app here: https://developer.android.com/training/system-ui/navigation

I didn’t realize it could be removed, and I’m not sure it can on my main device, a Galaxy Note 5, where it seems to be part of the physical design of the phone, and I don’t seem to have a setting for it in my phone settings.

For me it worked by adding the following code to OFActivity.java
(located at srcJava\cc\openframeworks\yourProjectNameHere)

// Added for fullscreen to OF.
@Override
public void onWindowFocusChanged(boolean hasFocus)
{
    super.onWindowFocusChanged(hasFocus);
    if (hasFocus)
    {
        hideSystemUI();
    }
}

private void hideSystemUI()
{
    // Enables regular immersive mode.
    // For "lean back" mode, remove SYSTEM_UI_FLAG_IMMERSIVE.
    // Or for "sticky immersive," replace it with SYSTEM_UI_FLAG_IMMERSIVE_STICKY
    View decorView = getWindow().getDecorView();
    decorView.setSystemUiVisibility
    (
        View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
        // Set the content to appear under the system bars so that the
        // content doesn't resize when the system bars hide and show.
        | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
        | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
        | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
        // Hide the nav bar and status bar
        | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
        | View.SYSTEM_UI_FLAG_FULLSCREEN
    );
}

Hope this helps.

2 Likes

Whoah. Tried it and just worked like a charm. Thanks a lot for this.

thanks for the replies, adding this code to OFActivity.java works for me. Thanks!

1 Like