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).
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.
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.