Google se compromete a impulsar la igualdad racial para las comunidades afrodescendientes. Obtén información al respecto.

BottomSheetDialog

public class BottomSheetDialog
extends AppCompatDialog

java.lang.Object
   ↳ android.app.Dialog
     ↳ androidx.appcompat.app.AppCompatDialog
       ↳ com.google.android.material.bottomsheet.BottomSheetDialog


Base class for Dialogs styled as a bottom sheet.

Summary

Inherited constants

Public constructors

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

Protected constructors

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

Public methods

void cancel()

This function can be called from a few different use cases, including Swiping the dialog down or calling `dismiss()` from a `BottomSheetDialogFragment`, tapping outside a dialog, etc...

BottomSheetBehavior<FrameLayout> getBehavior()
boolean getDismissWithAnimation()

Returns if dismissing will perform the swipe down animation on the bottom sheet, rather than the window animation for the dialog.

void setCancelable(boolean cancelable)
void setCanceledOnTouchOutside(boolean cancel)
void setContentView(View view)
void setContentView(int layoutResId)
void setContentView(View view, ViewGroup.LayoutParams params)
void setDismissWithAnimation(boolean dismissWithAnimation)

Set to perform the swipe down animation when dismissing instead of the window animation for the dialog.

Protected methods

void onCreate(Bundle savedInstanceState)
void onStart()

Inherited methods

Public constructors

BottomSheetDialog

public BottomSheetDialog (Context context)

Parameters
context Context

BottomSheetDialog

public BottomSheetDialog (Context context, 
                int theme)

Parameters
context Context

theme int

Protected constructors

BottomSheetDialog

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

Parameters
context Context

cancelable boolean

cancelListener DialogInterface.OnCancelListener

Public methods

cancel

public void cancel ()

This function can be called from a few different use cases, including Swiping the dialog down or calling `dismiss()` from a `BottomSheetDialogFragment`, tapping outside a dialog, etc...

The default animation to dismiss this dialog is a fade-out transition through a windowAnimation. Call ERROR(/#setDismissWithAnimation(true)) if you want to utilize the BottomSheet animation instead.

If this function is called from a swipe down interaction, or dismissWithAnimation is false, then keep the default behavior.

Else, since this is a terminal event which will finish this dialog, we override the attached BottomSheetBehavior.BottomSheetCallback to call this function, after BottomSheetBehavior.STATE_HIDDEN is set. This will enforce the swipe down animation before canceling this dialog.

getBehavior

public BottomSheetBehavior<FrameLayout> getBehavior ()

Returns
BottomSheetBehavior<FrameLayout>

getDismissWithAnimation

public boolean getDismissWithAnimation ()

Returns if dismissing will perform the swipe down animation on the bottom sheet, rather than the window animation for the dialog.

Returns
boolean

setCancelable

public void setCancelable (boolean cancelable)

Parameters
cancelable boolean

setCanceledOnTouchOutside

public void setCanceledOnTouchOutside (boolean cancel)

Parameters
cancel boolean

setContentView

public void setContentView (View view)

Parameters
view View

setContentView

public void setContentView (int layoutResId)

Parameters
layoutResId int

setContentView

public void setContentView (View view, 
                ViewGroup.LayoutParams params)

Parameters
view View

params ViewGroup.LayoutParams

setDismissWithAnimation

public void setDismissWithAnimation (boolean dismissWithAnimation)

Set to perform the swipe down animation when dismissing instead of the window animation for the dialog.

Parameters
dismissWithAnimation boolean: True if swipe down animation should be used when dismissing.

Protected methods

onCreate

protected void onCreate (Bundle savedInstanceState)

Parameters
savedInstanceState Bundle

onStart

protected void onStart ()