Modal Bottom Sheets
BottomSheetDialogFragment is a thin layer on top of the regular support
library Fragment that renders your fragment as a modal bottom sheet,
fundamentally acting as a dialog.
Modal bottom sheets render a shadow on the content below them to indicate that they are modal, essentially a dialog. If the content outside of the dialog is tapped then the bottom sheet is dismissed. Modal bottom sheets can be dragged vertically and dismissed by completely sliding them down.
Design & API Documentation
- Use one of the two versions of
showto display the dialog. Notice
BottomSheetDialogFragmentis a subclass of AppCompatFragment, which means you need to use
Note: Don’t call
setOnDismissListener on a
BottomSheetDialogFragment, instead you can override
onDismiss(DialogInterface) if necessary.
BottomSheetDialogFragments are a more modern version of
Dialogs. They have
a nicer-looking entrance animation and since they are pinned to the bottom they
may feel easier to use on larger devices.