79592560

Date: 2025-04-25 12:58:04
Score: 1
Natty:
Report link

I'm trying to hide both the status bar and navigation bar using:

WindowInsetsControllerCompat(window, window.decorView)
    .hide(WindowInsetsCompat.Type.systemBars())

This works correctly only when my theme is:

<style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar" />

But when I switch to a Material3 theme like:

<style name="Base.Theme.DaakiaTest" parent="Theme.Material3.Light.NoActionBar" />

...the navigation bar hides, but the status bar just becomes transparent with dark text, rather than fully hiding.

I'm already using:

WindowCompat.setDecorFitsSystemWindows(window, false)

I can’t switch back to the old MaterialComponents theme because my app uses Material3 components heavily, and switching would require large UI refactoring.

So my question is: Why does WindowInsetsControllerCompat.hide(WindowInsetsCompat.Type.statusBars()) not fully hide the status bar when using a Material3 theme?

Is there a workaround that allows full immersive mode with Theme.Material3.Light.NoActionBar?

Any guidance would be much appreciated!

Reasons:
  • Blacklisted phrase (1): appreciated
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Ashif Ali