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

ModalBottomSheetProperties

@ExperimentalMaterial3Api
public final class ModalBottomSheetProperties


Properties used to customize the behavior of a ModalBottomSheet.

Summary

Public constructors

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

Public methods

boolean
equals(Object other)
final @NonNull SecureFlagPolicy

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

final boolean

Whether the modal bottom sheet can be dismissed by pressing the back button.

int
final boolean

Whether the modal bottom sheet is focusable.

Public constructors

ModalBottomSheetProperties

public ModalBottomSheetProperties(
    @NonNull SecureFlagPolicy securePolicy,
    boolean isFocusable,
    boolean shouldDismissOnBackPress
)
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.

Public methods

equals

public boolean equals(Object other)

getSecurePolicy

public final @NonNull SecureFlagPolicy getSecurePolicy()

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

getShouldDismissOnBackPress

public final boolean getShouldDismissOnBackPress()

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.

hashCode

public int hashCode()

isFocusable

public final 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.