ModalBottomSheetProperties

Class

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

Properties used to customize the behavior of a ModalBottomSheet.

Parameters

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

Secondary Constructors

constructor(shouldDismissOnBackPress: Boolean)

Properties

Common
val shouldDismissOnBackPress: Boolean
Common
val shouldDismissOnClickOutside: Boolean
Android
@ExperimentalMaterial3Api
actual class ModalBottomSheetProperties

Properties used to customize the behavior of a ModalBottomSheet.

Parameters

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

Secondary Constructors

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.

actual constructor(shouldDismissOnBackPress: Boolean, shouldDismissOnClickOutside: Boolean) {
    this.securePolicy = SecureFlagPolicy.Inherit
    this.shouldDismissOnBackPress = shouldDismissOnBackPress
    this.shouldDismissOnClickOutside = shouldDismissOnClickOutside
    this.isAppearanceLightNavigationBars = null
    this.isAppearanceLightStatusBars = null
}
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

securePolicyPolicy for setting WindowManager.LayoutParams.FLAG_SECURE on the bottom sheet's window.
shouldDismissOnBackPressWhether the modal bottom sheet can be dismissed by pressing the back button. If true, pressing the back button will call onDismissRequest.
shouldDismissOnClickOutsideWhether the modal bottom sheet can be dismissed by clicking on the scrim.
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

isAppearanceLightStatusBarsIf 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.
isAppearanceLightNavigationBarsIf 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.
securePolicyPolicy for setting WindowManager.LayoutParams.FLAG_SECURE on the bottom sheet's window.
shouldDismissOnBackPressWhether the modal bottom sheet can be dismissed by pressing the back button. If true, pressing the back button will call onDismissRequest.
shouldDismissOnClickOutsideWhether the modal bottom sheet can be dismissed by clicking on the scrim.
actual constructor(shouldDismissOnBackPress: Boolean) : this(shouldDismissOnBackPress, true)
constructor(
    securePolicy: SecureFlagPolicy = SecureFlagPolicy.Inherit,
    shouldDismissOnBackPress: Boolean = true,
) : this(securePolicy, shouldDismissOnBackPress, true)
constructor(
    isAppearanceLightStatusBars: Boolean,
    isAppearanceLightNavigationBars: Boolean,
    securePolicy: SecureFlagPolicy = SecureFlagPolicy.Inherit,
    shouldDismissOnBackPress: Boolean = true,
) {
    this.shouldDismissOnBackPress = shouldDismissOnBackPress
    this.shouldDismissOnClickOutside = true
    this.securePolicy = securePolicy
    this.isAppearanceLightStatusBars = isAppearanceLightStatusBars
    this.isAppearanceLightNavigationBars = isAppearanceLightNavigationBars
}

Properties

Android
val securePolicy: SecureFlagPolicy
Android
actual val shouldDismissOnBackPress: Boolean
Android
actual val shouldDismissOnClickOutside: Boolean