Skip to content

Most visited

Recently visited

navigation

BottomSheetDialog

public class BottomSheetDialog
extends AppCompatDialog

java.lang.Object
   ↳ android.app.Dialog
     ↳ android.support.v7.app.AppCompatDialog
       ↳ android.support.design.widget.BottomSheetDialog


Base class for Dialogs styled as a bottom sheet.

Summary

Inherited constants

From interface android.content.DialogInterface

Public constructors

BottomSheetDialog(Context context)
BottomSheetDialog(Context context, int theme)

Protected constructors

BottomSheetDialog(Context context, boolean cancelable, DialogInterface.OnCancelListener cancelListener)

Public methods

void setCancelable(boolean cancelable)

Sets whether this dialog is cancelable with the BACK key.

void setCanceledOnTouchOutside(boolean cancel)

Sets whether this dialog is canceled when touched outside the window's bounds.

void setContentView(View view)

Set the screen content to an explicit view.

void setContentView(int layoutResId)

Set the screen content from a layout resource.

void setContentView(View view, ViewGroup.LayoutParams params)

Set the screen content to an explicit view.

Protected methods

void onCreate(Bundle savedInstanceState)

Similar to onCreate(Bundle), you should initialize your dialog in this method, including calling setContentView(View).

void onStart()

Called when the dialog is starting.

Inherited methods

From class android.support.v7.app.AppCompatDialog
From class android.app.Dialog
From class java.lang.Object
From interface android.support.v7.app.AppCompatCallback
From interface android.content.DialogInterface
From interface android.view.Window.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.View.OnCreateContextMenuListener

Public constructors

BottomSheetDialog

added in version 23.2.0
BottomSheetDialog (Context context)

Parameters
context Context

BottomSheetDialog

added in version 23.2.0
BottomSheetDialog (Context context, 
                int theme)

Parameters
context Context
theme int

Protected constructors

BottomSheetDialog

added in version 23.2.0
BottomSheetDialog (Context context, 
                boolean cancelable, 
                DialogInterface.OnCancelListener cancelListener)

Parameters
context Context
cancelable boolean
cancelListener DialogInterface.OnCancelListener

Public methods

setCancelable

void setCancelable (boolean cancelable)

Sets whether this dialog is cancelable with the BACK key.

Parameters
cancelable boolean

setCanceledOnTouchOutside

void setCanceledOnTouchOutside (boolean cancel)

Sets whether this dialog is canceled when touched outside the window's bounds. If setting to true, the dialog is set to be cancelable if not already set.

Parameters
cancel boolean: Whether the dialog should be canceled when touched outside the window.

setContentView

void setContentView (View view)

Set the screen content to an explicit view. This view is placed directly into the screen's view hierarchy. It can itself be a complex view hierarchy.

Parameters
view View: The desired content to display.

setContentView

void setContentView (int layoutResId)

Set the screen content from a layout resource. The resource will be inflated, adding all top-level views to the screen.

Parameters
layoutResId int: Resource ID to be inflated.

setContentView

void setContentView (View view, 
                ViewGroup.LayoutParams params)

Set the screen content to an explicit view. This view is placed directly into the screen's view hierarchy. It can itself be a complex view hierarchy.

Parameters
view View: The desired content to display.
params ViewGroup.LayoutParams: Layout parameters for the view.

Protected methods

onCreate

void onCreate (Bundle savedInstanceState)

Similar to onCreate(Bundle), you should initialize your dialog in this method, including calling setContentView(View).

Parameters
savedInstanceState Bundle: If this dialog is being reinitialized after a the hosting activity was previously shut down, holds the result from the most recent call to onSaveInstanceState(), or null if this is the first time.

onStart

void onStart ()

Called when the dialog is starting.

This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.