Most visited

Recently visited

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 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).

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

BottomSheetDialog (Context context)

Parameters
context Context

BottomSheetDialog

BottomSheetDialog (Context context, 
                int theme)

Parameters
context Context
theme int

Protected constructors

BottomSheetDialog

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

Parameters
context Context
cancelable boolean
cancelListener DialogInterface.OnCancelListener

Public methods

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.

Hooray!