Hello, guys. Can the content be moved above the status bar dynamically inside a fragment?
I’m currently in the process of refactoring an old architecture, which is a step-by-step process.
I must put my compose code inside a fragment, and there, I must move the content above the status bar.
Could someone help me?
I’ve tried something similar: but didn’t worked
Copy code
val window = (context as BottomNavigationActivity).window
val insetsController = WindowInsetsControllerCompat(window, window.decorView)
insetsController.hide(WindowInsetsCompat.Type.statusBars())
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
}