I have been trying to make a fragment fullscreen, but almost every answer on the web has deprecated methods. Even the android official site has a deprecated method
You can clearly see navigation and status bars are still there.
Can you share the proper and latest way to get fullscreen in fragment?
CodePudding user response:
If you read the docs for ViewCompat.getWindowInsetsController(), you'll see that it's only deprecated because they want you to use getInsetsController() instead. Otherwise, the sample code works just fine.
CodePudding user response:
Can you use the theme as follows
<style name="AppTheme"parent="Theme.MaterialComponents.DayNight.NoActionBar">
<item name="android:windowNoTitle">true</item>
<item name="android:windowActionBar">false</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowContentOverlay">@null</item>
</style>