Search code examples
androidmaterial-components-androidandroid-bottomsheetdialog

How can i find thd implementation details in Android Developers Doc?


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.


Solution

  • 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. Notice BottomSheetDialogFragment is a subclass of AppCompatFragment, which means you need to use Activity.getSupportFragmentManager().

    Note: Don't call setOnCancelListener or setOnDismissListener on a BottomSheetDialogFragment, instead you can override onCancel(DialogInterface) or onDismiss(DialogInterface) if necessary.