{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

ModalBottomSheetDefaults

@ExperimentalMaterial3Api
public static class ModalBottomSheetDefaults


Default values for ModalBottomSheet

Summary

Public fields

static @NonNull ModalBottomSheetDefaults

Public methods

final @NonNull ModalBottomSheetProperties
properties(
    @NonNull SecureFlagPolicy securePolicy,
    boolean isFocusable,
    boolean shouldDismissOnBackPress
)

Properties used to customize the behavior of a ModalBottomSheet.

Public fields

INSTANCE

public static @NonNull ModalBottomSheetDefaults INSTANCE

Public methods

properties

public final @NonNull ModalBottomSheetProperties properties(
    @NonNull SecureFlagPolicy securePolicy,
    boolean isFocusable,
    boolean shouldDismissOnBackPress
)

Properties used to customize the behavior of a ModalBottomSheet.

Parameters
@NonNull SecureFlagPolicy securePolicy

Policy for setting WindowManager.LayoutParams.FLAG_SECURE on the bottom sheet's window.

boolean isFocusable

Whether the modal bottom sheet is focusable. When true, the modal bottom sheet will receive IME events and key presses, such as when the back button is pressed.

boolean shouldDismissOnBackPress

Whether the modal bottom sheet can be dismissed by pressing the back button. If true, pressing the back button will call onDismissRequest. Note that isFocusable must be set to true in order to receive key events such as the back button - if the modal bottom sheet is not focusable then this property does nothing.