androidandroid-immersive

Declare fullscreen and immersive app in manifest


I have this styles.xml

<resources>
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        ...
        <item name="android:windowFullscreen">true</item>
        ...
    </style>
</resources>

then use this as the theme for my app via

<manifest>
    <application android:theme="@style/AppTheme"/>
</manifest>

My app goes immersive mode. The problem is the navigation bar won't go immersive. Is there a way to achieve this in manifest?

PS. I am aware of this (Set Android immersive full screen mode in manifest) question but doesn't answer my navigation bar question. Plus, the answer is old(?).


Solution

  • For your case of navigation bar that does not go immersive and which you are aware that it is temporary mode. You may have to configure them again as you leave an activity or moving to another activity. This is a bit tedious if you have a lot of activity and could be a reason you are looking for a way to configure this from manifest as global settings(not possible).

    You may use fragments as alternative so you only move between fragments and it wont trigger the navigation to reset visibility and show again.