PopupProperties

Class

Common
expect class PopupProperties(
    focusable: Boolean = false,
    dismissOnBackPress: Boolean = true,
    dismissOnClickOutside: Boolean = true,
    clippingEnabled: Boolean = true,
)

Properties used to customize the behavior of a Popup.

Properties

Common
val focusable: Boolean
Common
val dismissOnBackPress: Boolean
Common
val dismissOnClickOutside: Boolean
Common
val clippingEnabled: Boolean
Android
actual class PopupProperties
constructor(
    internal val flags: Int,
    internal val inheritSecurePolicy: Boolean = true,
    actual val dismissOnBackPress: Boolean = true,
    actual val dismissOnClickOutside: Boolean = true,
    val excludeFromSystemGesture: Boolean = true,
    val usePlatformDefaultWidth: Boolean = false,
)

Properties used to customize the behavior of a Popup.

Secondary Constructors

actual constructor(
    focusable: Boolean,
    dismissOnBackPress: Boolean,
    dismissOnClickOutside: Boolean,
    clippingEnabled: Boolean,
) : this(
    focusable = focusable,
    dismissOnBackPress = dismissOnBackPress,
    dismissOnClickOutside = dismissOnClickOutside,
    securePolicy = SecureFlagPolicy.Inherit,
    excludeFromSystemGesture = true,
    clippingEnabled = clippingEnabled,
)
constructor(
    focusable: Boolean = false,
    dismissOnBackPress: Boolean = true,
    dismissOnClickOutside: Boolean = true,
    securePolicy: SecureFlagPolicy = SecureFlagPolicy.Inherit,
    excludeFromSystemGesture: Boolean = true,
    clippingEnabled: Boolean = true,
) : this(
    focusable = focusable,
    dismissOnBackPress = dismissOnBackPress,
    dismissOnClickOutside = dismissOnClickOutside,
    securePolicy = securePolicy,
    excludeFromSystemGesture = excludeFromSystemGesture,
    clippingEnabled = clippingEnabled,
    usePlatformDefaultWidth = false,
)
constructor(
    focusable: Boolean = false,
    dismissOnBackPress: Boolean = true,
    dismissOnClickOutside: Boolean = true,
    securePolicy: SecureFlagPolicy = SecureFlagPolicy.Inherit,
    excludeFromSystemGesture: Boolean = true,
    clippingEnabled: Boolean = true,
    usePlatformDefaultWidth: Boolean = false,
) : this(
    flags = createFlags(focusable, securePolicy, clippingEnabled),
    inheritSecurePolicy = securePolicy == SecureFlagPolicy.Inherit,
    dismissOnBackPress = dismissOnBackPress,
    dismissOnClickOutside = dismissOnClickOutside,
    excludeFromSystemGesture = excludeFromSystemGesture,
    usePlatformDefaultWidth = usePlatformDefaultWidth,
)

Constructs a PopupProperties with the given behaviors. This constructor is to support multiplatform and maintain backwards compatibility. Consider the overload that takes a flags parameter if more precise control over the popup flags is desired.

Parameters

focusableWhether the popup is focusable. When true, the popup will receive IME events and key presses, such as when the back button is pressed.
dismissOnBackPressWhether the popup can be dismissed by pressing the back or escape buttons. If true, pressing the back or escape buttons will call onDismissRequest. Note that focusable must be set to true in order to receive key events such as the back button. If the popup is not focusable, then this property does nothing.
dismissOnClickOutsideWhether the popup can be dismissed by clicking outside the popup's bounds. If true, clicking outside the popup will call onDismissRequest.
securePolicyPolicy for setting WindowManager.LayoutParams.FLAG_SECURE on the popup's window.
excludeFromSystemGestureA flag to check whether to set the systemGestureExclusionRects. The default is true.
clippingEnabledWhether to allow the popup window to extend beyond the bounds of the screen. By default the window is clipped to the screen boundaries. Setting this to false will allow windows to be accurately positioned. The default value is true.
usePlatformDefaultWidthWhether the width of the popup's content should be limited to the platform default, which is smaller than the screen width.

Properties

Android
actual val focusable: Boolean

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

Android
val securePolicy: SecureFlagPolicy

Policy for how WindowManager.LayoutParams.FLAG_SECURE is set on the popup's window.

Android
actual val clippingEnabled: Boolean

Whether the popup window is clipped to the screen boundaries, or allowed to extend beyond the bounds of the screen.