Avatar ·

The systemUiVisibility method is deprecated in Android. What should replace it in Kotlin?

Hello everyone! I'm writing a simple app in Kotlin, and I need to enable full-screen mode to hide the system navigation bar and status bar. Previously, I used this code: ```kotlin window.decorView.systemUiVisibility = ( View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_FULLSCREEN or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY ) ``` But the studio highlights `systemUiVisibility` as a deprecated property. The documentation says that starting from Android 11 (API 30) it is not recommended to use it, and in future versions it may be completely removed. I'm using compileSdk 34 and minSdk 26. I tried googling, but found a lot of scattered information: some advise `WindowInsetsController`, some advise `WindowCompat.setDecorFitsSystemWindows()`, and some advi