Android 15+ : Status and Nav Bar Colours

Well, I started testing with the first version of the code you gave and since you mentioned that it wasn't compatible with older versions of Android, I set out to make it compatible (unfortunately, I haven't been able to find anyone with Android below 10 to test if it works).

In my case, I use the androidx.core.1.14.0.jar library and delegate compatibility to it, removing the light and dark options you provided.

I have a version where the user must place an arrangement to recreate a fake bar on Android 15 (but I haven't tested it yet, ha ha ha).

Here's the code for the stable version so far!

Hidebars MOD [TIMAI2].txt (5.9 KB)

Oh, I see your problem.

That's how I tested it.

Let me see if I can recreate it with my code :thinking: :smiley:.

image

Sorry, this method should not be used, I left it in the extension by mistake

[EDIT] aix updated

1 Like

Please explain in more detail.

Try the aia. Or I can make a video.

I agree, I just haven't found a way yet for the nav bar.

Try this:

Blocks

I can only repeat myself: This madness that Google is increasingly burdening us with is no longer bearable. :upside_down_face: :rage:

Where is the SystemBars extension from ?

Colour Nav Bar separately to Status Bar ?

I've experimented a bit and at least I've gotten that far.

Yes, but only with a trick (see my blocks). Once the navbar is colored, at least the colored area can no longer be hidden, only the line in the middle.

Anything different about the extension code compared to what I came up with?

But there lies the problem that most ai2 districts have.
They leave that black patch, which is solved in the code I am sharing.

At least in the apk you provide, with the code and TIM's AIA, that problem does not exist.

Android version and device name?

@DO-FU

Looking at your extension code:

private void applyColors() {
        Window window = activity.getWindow();
        if (window != null) {
            window.setStatusBarColor(currentStatusBarColor);
            window.setNavigationBarColor(currentNavBarColor);
        }
    }

This is now deprecated for Android 15+ devices, it does not work. The aim of this topic is to find solutions for the new google world.

But you have shown me how to use Compat, which seems to be being used a lot in windows/inset methods and solutions...

import androidx.core.view.WindowCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.core.view.WindowInsetsControllerCompat;

Yes, I know, I left it in the code to make it compatible with older versions of Android (in the new version, I describe better when Android requires its use). Even if it's not compatible with Android, the app doesn't crash.

Yes, with Window Compat, it's quite practical. The only problem I've encountered so far is what Anke mentioned, which is that I wanted to individualize the hides. The hides now work perfectly.

The problem is in coloring the bars, especially in the navbar, because if the status bar is visible, it doesn't paint it due to the edge-to-edge issue.
And if I remove the edge-to-edge in the status bar, it leaves that black patch that I showed in the comments above.

The other thing is that I tried to make a fake bar, with a layout that works halfway. I have to find the logic so that it shows up when the user wants to add color and set the size, since with WindowInsetsListener it gives me a very unreliable measurement, but oh well.

Leaves black edge patch

Android 14 - POCO X3 PRO
Android 12 - Redmi7A

Now on Android 15, it works flawlessly.
S25 Ultra (video attached)

1 Like

You should try the original HideBars extension, that works fine on pre Android 15 devices.

From there, I took it to make the code I gave you, which works well on the latest Android devices.

But you mentioned not supporting older versions.

I haven't said this anywhere.



Did I understand wrong?
xD