u/ImNotHuman67

Hi everyone,

I’m working on a 2D Game Editor called Applet Engine using Next.js and Capacitor. I’m building the APK via GitHub Actions (YAML), but I can't seem to hide the status bar (the top system bar) no matter what I do.

The Problem:

I want a total immersive fullscreen mode. I’ve tried using GitHub Actions to inject Java code into MainActivity.java and modifying styles.xml. However, the status bar still appears (see attached image).

What I've Tried:

I've used Gemini and Claude over 10 times to refine the script.

They keep suggesting the old setSystemUiVisibility flags (like SYSTEM_UI_FLAG_IMMERSIVE_STICKY), but it seems like modern Android versions (API 30+) are ignoring them or the Capacitor plugin is overriding it.

I've set windowFullscreen to true in styles.xml.

I've tried the @capacitor/status-bar plugin with "hidden": true in capacitor.config.json.

Current Script (GitHub Actions Snippet):

# This is how I currently inject the Java code

- name: Rewrite MainActivity

run: |

cat << 'EOF' > app/src/main/java/com/visualengine/app/MainActivity.java

package com.visualengine.app;

import android.os.Bundle;

import android.view.View;

import com.getcapacitor.BridgeActivity;

public class MainActivity extends BridgeActivity {

@Override

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

hideSystemUI();

}

private void hideSystemUI() {

getWindow().getDecorView().setSystemUiVisibility(

View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_FULLSCREEN

);

}

}

EOF

=====================

Question:

Does anyone have a modern TypeScript or Java (MainActivity) snippet that actually works for Android 11 through 14? I suspect I should be using WindowInsetsController, but I’m not sure how to implement it correctly within a Capacitor/GitHub Actions workflow.

Why is the AI constantly giving me deprecated code that doesn't work on newer devices? Any help would be greatly appreciated!

(Note: Text generated by AI as I am more comfortable with English reading than writing.)

u/ImNotHuman67 — 20 days ago