public class SideSheetDialog

Base class for android.app.Dialogs styled as a side sheet.

For more information, see the component developer guidance and design guidelines.

Summary

Public constructors

Public methods

cancel

public void cancel()

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

The default animation to dismiss this dialog is a fade-out transition through a windowAnimation. Set setDismissWithSheetAnimationEnabled to true if you want to utilize the sheet animation instead.

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

isDismissWithSheetAnimationEnabled

public boolean isDismissWithSheetAnimationEnabled()

Returns whether dismissing will perform the swipe away animation on the sheet, rather than the window animation for the dialog.

setContentView

public void setContentView(View view, LayoutParams params)

setDismissWithSheetAnimationEnabled

public void setDismissWithSheetAnimationEnabled(boolean dismissWithAnimation)

Set whether to perform the swipe away animation on the sheet when dismissing, rather than the window animation for the dialog.

Parameters
boolean dismissWithAnimation

True if swipe away animation should be used when dismissing.

setSheetEdge

public void setSheetEdge(int gravity)

Set the edge which the sheet should originate from.

Note: This method should be called when the sheet is initialized, before it is shown. Runtime sheet edge changes are not supported.

Parameters
int gravity

the edge from which the sheet and its animations should originate.

Protected methods

onCreate

protected void onCreate(Bundle savedInstanceState)

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2025-10-28 UTC.