lightbulb_outline Help shape the future of the Google Play Console, Android Studio, and Firebase. Start survey
added in version 23.4.0
belongs to Maven artifact com.android.support:design:27.1.0

BottomSheetDialogFragment

public class BottomSheetDialogFragment
extends AppCompatDialogFragment

java.lang.Object
   ↳ android.support.v4.app.Fragment
     ↳ android.support.v4.app.DialogFragment
       ↳ android.support.v7.app.AppCompatDialogFragment
         ↳ android.support.design.widget.BottomSheetDialogFragment


Modal bottom sheet. This is a version of DialogFragment that shows a bottom sheet using BottomSheetDialog instead of a floating dialog.

Summary

Inherited constants

From class android.support.v4.app.DialogFragment

Public constructors

BottomSheetDialogFragment()

Public methods

Dialog onCreateDialog(Bundle savedInstanceState)

Override to build your own custom Dialog container.

Inherited methods

From class android.support.v7.app.AppCompatDialogFragment
From class android.support.v4.app.DialogFragment
From class android.support.v4.app.Fragment
From class java.lang.Object
From interface android.content.DialogInterface.OnCancelListener
From interface android.content.DialogInterface.OnDismissListener
From interface android.content.ComponentCallbacks
From interface android.view.View.OnCreateContextMenuListener
From interface android.arch.lifecycle.LifecycleOwner
From interface android.arch.lifecycle.ViewModelStoreOwner

Public constructors

BottomSheetDialogFragment

added in version 23.4.0
BottomSheetDialogFragment ()

Public methods

onCreateDialog

added in version 23.4.0
Dialog onCreateDialog (Bundle savedInstanceState)

Override to build your own custom Dialog container. This is typically used to show an AlertDialog instead of a generic Dialog; when doing so, onCreateView(LayoutInflater, ViewGroup, Bundle) does not need to be implemented since the AlertDialog takes care of its own content.

This method will be called after onCreate(Bundle) and before onCreateView(LayoutInflater, ViewGroup, Bundle). The default implementation simply instantiates and returns a Dialog class.

Note: DialogFragment own the Dialog.setOnCancelListener and Dialog.setOnDismissListener callbacks. You must not set them yourself. To find out about these events, override onCancel(DialogInterface) and onDismiss(DialogInterface).

Parameters
savedInstanceState Bundle: The last saved instance state of the Fragment, or null if this is a freshly created Fragment.

Returns
Dialog Return a new Dialog instance to be displayed by the Fragment.