Create a Modal Bottom Sheet


compile '<latest-library-version>'

Create a class that extends BottomSheetDialogFragment , inflated with the layout that will be used as the content of the modal dialog.

public class BottomSheetFragment extends BottomSheetDialogFragment {

    public BottomSheetFragment() {
        // Required empty public constructor

    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        return inflater.inflate(R.layout.fragment_bottom_sheet, container, false);


Create an instance of the modal bottom sheet and show it with the show method, passing the FragmentManager and a string tag as parameters.

CustomBottomSheetDialog bottomSheetDialog = CustomBottomSheetDialog.getInstance();, "Custom Bottom Sheet");