Navigation bar issue

I came across a bug because of which the navigation bar is not hidden after you open and close the keyboard or if a notification about phone discharge arrives.




if there is a way to fix it or if not how to make the app not full screen and change the color of the navigation bar?

1 Like

I don’t think it’s going to help anything.

boolean keyboardOpen=false;

void setup(){

}

void draw(){
background(100,150,255);
textSize(50);
fill(255);
textAlign(CENTER,CENTER);
text(“testing”,width/2,height/2);
stroke(255);
strokeWeight(2);
noFill();
rectMode(CENTER);
rect(width/2,height/2,width,1280);
}

void touchStarted(){
if(touches[0].y<720)
if(!keyboardOpen)
openKeyboard();
else
closeKeyboard();
}

You may try fullScreen() or have a look in ‘sketch properties’ options. But it isnt a real full screen in Android actually.

I was able to find a solution to make full screen mode work properly.

import android.app.Activity;
import android.os.Bundle;
import android.view.WindowManager;
import android.view.Window;



public class MainActivity extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(
        WindowManager.LayoutParams.FLAG_FULLSCREEN,
        WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.main);
    }
}


boolean keyboardOpen=false;


void setup(){
}

void draw(){
  background(255);
}

void touchStarted(){
  if(mouseY<height*0.5f){
    if(!keyboardOpen)
    openKeyboard();
    else
    closeKeyboard();
    keyboardOpen=!keyboardOpen;
  }
}

But unfortunately I still don’t know how to change the color of the navigation bar.