Class

ModalBottomSheetProperties

Properties used to customize the behavior of a ModalBottomSheet.

Source set: Common

Added in 1.5.0-alpha17

@ExperimentalMaterial3Api
expect class ModalBottomSheetProperties(
    shouldDismissOnBackPress: Boolean = true,
    shouldDismissOnClickOutside: Boolean = true,
)

Properties used to customize the behavior of a ModalBottomSheet.

Parameters

shouldDismissOnBackPress Whether the modal bottom sheet can be dismissed by pressing the back button. If true, pressing the back button will call onDismissRequest.
shouldDismissOnClickOutside Whether the modal bottom sheet can be dismissed by clicking on the scrim.

Properties

shouldDismissOnBackPress

Source set: Common

Added in 1.5.0-alpha17

val shouldDismissOnBackPress: Boolean

shouldDismissOnClickOutside

Source set: Common

Added in 1.5.0-alpha17

val shouldDismissOnClickOutside: Boolean
Source set: Android

Added in 1.5.0-alpha17

@ExperimentalMaterial3Api
actual class ModalBottomSheetProperties

Properties used to customize the behavior of a ModalBottomSheet.

Parameters

securePolicy Policy for setting WindowManager.LayoutParams.FLAG_SECURE on the bottom sheet's window.
shouldDismissOnBackPress Whether the modal bottom sheet can be dismissed by pressing the back button. If true, pressing the back button will call onDismissRequest.

Secondary Constructors

Added in 1.5.0-alpha17

constructor() {
    this.securePolicy = SecureFlagPolicy.Inherit
    this.shouldDismissOnBackPress = true
    this.shouldDismissOnClickOutside = true
    this.isAppearanceLightStatusBars = null
    this.isAppearanceLightNavigationBars = null
}

Properties used to customize the behavior of a ModalBottomSheet.

This constructor provides default behavior for ModalBottomSheet. See other constructors for customization options.

Added in 1.5.0-alpha17

actual constructor(shouldDismissOnBackPress: Boolean, shouldDismissOnClickOutside: Boolean) {
    this.securePolicy = SecureFlagPolicy.Inherit
    this.shouldDismissOnBackPress = shouldDismissOnBackPress
    this.shouldDismissOnClickOutside = shouldDismissOnClickOutside
    this.isAppearanceLightNavigationBars = null
    this.isAppearanceLightStatusBars = null
}

Added in 1.5.0-alpha17

constructor(
    securePolicy: SecureFlagPolicy = SecureFlagPolicy.Inherit,
    shouldDismissOnBackPress: Boolean = true,
    shouldDismissOnClickOutside: Boolean = true,
) {
    this.securePolicy = securePolicy
    this.shouldDismissOnBackPress = shouldDismissOnBackPress
    this.shouldDismissOnClickOutside = shouldDismissOnClickOutside
    this.isAppearanceLightNavigationBars = null
    this.isAppearanceLightStatusBars = null
}

Properties used to customize the behavior of a ModalBottomSheet.

Parameters

securePolicy Policy for setting WindowManager.LayoutParams.FLAG_SECURE on the bottom sheet's window.
shouldDismissOnBackPress Whether the modal bottom sheet can be dismissed by pressing the back button. If true, pressing the back button will call onDismissRequest.
shouldDismissOnClickOutside Whether the modal bottom sheet can be dismissed by clicking on the scrim.

Added in 1.5.0-alpha17

constructor(
    isAppearanceLightStatusBars: Boolean,
    isAppearanceLightNavigationBars: Boolean,
    securePolicy: SecureFlagPolicy = SecureFlagPolicy.Inherit,
    shouldDismissOnBackPress: Boolean = true,
    shouldDismissOnClickOutside: Boolean = true,
) {
    this.shouldDismissOnBackPress = shouldDismissOnBackPress
    this.shouldDismissOnClickOutside = shouldDismissOnClickOutside
    this.securePolicy = securePolicy
    this.isAppearanceLightStatusBars = isAppearanceLightStatusBars
    this.isAppearanceLightNavigationBars = isAppearanceLightNavigationBars
}

Properties used to customize the behavior of a ModalBottomSheet.

Use this constructor to customize the behavior of status and navigation bars on the ModalBottomSheet window.

Parameters

isAppearanceLightStatusBars If true, changes the foreground color of the status bars to light so that the items on the bar can be read clearly. If false, reverts to the default appearance.
isAppearanceLightNavigationBars If true, changes the foreground color of the navigation bars to light so that the items on the bar can be read clearly. If false, reverts to the default appearance.
securePolicy Policy for setting WindowManager.LayoutParams.FLAG_SECURE on the bottom sheet's window.
shouldDismissOnBackPress Whether the modal bottom sheet can be dismissed by pressing the back button. If true, pressing the back button will call onDismissRequest.
shouldDismissOnClickOutside Whether the modal bottom sheet can be dismissed by clicking on the scrim.

Properties

securePolicy

Source set: Android

Added in 1.5.0-alpha17

val securePolicy: SecureFlagPolicy

shouldDismissOnBackPress

Source set: Android

Added in 1.5.0-alpha17

actual val shouldDismissOnBackPress: Boolean

shouldDismissOnClickOutside

Source set: Android

Added in 1.5.0-alpha17

actual val shouldDismissOnClickOutside: Boolean