I have a class that inherits from BottomSheetDialogFragment and has an onCreateDialog function as follows
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val bottomSheetDialog = super.onCreateDialog(savedInstanceState) as BottomSheetDialog
binding = FragmentSelectCastDeviceBinding.inflate(layoutInflater)
bottomSheetDialog.setContentView(binding.root)
hideNavigationBarInDialog(bottomSheetDialog)
initMain()
return bottomSheetDialog
}
fun hideNavigationBarInDialog(dialog: Dialog) {
dialog.window?.let { window ->
WindowCompat.setDecorFitsSystemWindows(window, false)
WindowInsetsControllerCompat(window, window.decorView).let { controller ->
controller.hide(WindowInsetsCompat.Type.navigationBars())
controller.systemBarsBehavior =
WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
}
}
}
My problem is that it is hidden, but it still has the width of the navigationBar remaining, how can I remove that width? The part I highlighted in red is the width of the navigationBar after being hidden