I'm trying to make my BottomSheetDialogFragment
to be fullscreen when it's opened, the issue is that in any case the Dialog
is shown half of screen height.
I've tried to set the peekHeight as the following:
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
dialog?.setOnShowListener { dialog ->
val bottomSheetBehavior: BottomSheetBehavior<*> = (dialog as BottomSheetDialog).behavior
bottomSheetBehavior.peekHeight = Resources.getSystem().displayMetrics.heightPixels
bottomSheetBehavior.state = BottomSheetBehavior.STATE_EXPANDED
}
}
But the Dialog
is shown as same as without the peekHeight.
Then i've tried to add android:theme="@android:style/Theme.Material.Light.NoActionBar.Fullscreen"
In my BottomSheet
layout but still had the same result.