Search code examples
androidandroid-fullscreenandroid-11

How to change systemUIVisibility on SdkVersion 30


Recently Google has deprecated setting system UI visibility directly using the setSystemUIVisibility method found in the View class and passing flags to it.

Deprecated setSystemUiVisibility method

I couldn't find the source code for this as it's not released publically yet. Do you guys know how I can achieve going fullscreen without using this method?


Solution

  • Yes now since it is deprecated, you can use:

    window.setDecorFitsSystemWindows(false)
    

    Then make sure you make the status bar transparent as well by adding below style to your app theme

    <item name="android:navigationBarColor">@android:color/transparent</item>
    

    Hope this helps :)