Code: Select all
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun CustomModalBottomSheet(...){ // Arguments for the custom modal bottom sheet
ModalBottomSheet(...){ // Arguments for ModalBottomSheet, content in this block
...
val view = LocalView.current
view.onFocusChangeListener = View.OnFocusChangeListener { v, _ ->
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.R)
v.windowInsetsController?.hide(
android.view.WindowInsets.Type.statusBars()
)
else v.systemUiVisibility = View.SYSTEM_UI_FLAG_FULLSCREEN
}
SideEffect {
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.R)
view.windowInsetsController?.hide(
android.view.WindowInsets.Type.statusBars()
)
else view.systemUiVisibility = View.SYSTEM_UI_FLAG_FULLSCREEN
}
...
}
}
Mobile version