When i view others Android code, i find a class which extends BottomSheetDialogFragment
. I want to use it (BottomSheetDialogFragment
), then I find it need to add implementation in build.gradle(app)
. I had viewed this website BottomSheetDialogFragment
in official Doc. But I can not found any implementation details about BottomSheetDialogFragment
. I finally found implementation in other tutorial by Google. I want to konw how can find the implementation details in Official Doc.
Asked
Active
Viewed 33 times
0

Gabriele Mariotti
- 320,139
- 94
- 887
- 841

WoodPecker
- 19
- 4
-
The `BottomSheetDialogFragment` is part of the material components library: https://material.io/develop/android/docs/getting-started – Henry Twist Mar 28 '21 at 12:44
1 Answers
1
The BottomSheetDialogFragment
is provided by the Material Components Library:
Relevant part of the doc about the usage:
- Subclass
BottomSheetDialogFragment
- Override the
onCreateView
method. - Use one of the two versions of
show
to display the dialog. NoticeBottomSheetDialogFragment
is a subclass ofAppCompatFragment
, which means you need to useActivity.getSupportFragmentManager()
.
Note: Don't call setOnCancelListener
or setOnDismissListener
on a BottomSheetDialogFragment
, instead you can override onCancel(DialogInterface)
or onDismiss(DialogInterface)
if necessary.

Gabriele Mariotti
- 320,139
- 94
- 887
- 841