PopupProperties


Properties used to customize the behavior of a Popup.

Summary

Public constructors

PopupProperties(
    focusable: Boolean,
    dismissOnBackPress: Boolean,
    dismissOnClickOutside: Boolean,
    clippingEnabled: Boolean
)
Cmn
android
PopupProperties(
    flags: Int,
    inheritSecurePolicy: Boolean,
    dismissOnBackPress: Boolean,
    dismissOnClickOutside: Boolean,
    excludeFromSystemGesture: Boolean,
    usePlatformDefaultWidth: Boolean
)
android
PopupProperties(
    focusable: Boolean,
    dismissOnBackPress: Boolean,
    dismissOnClickOutside: Boolean,
    securePolicy: SecureFlagPolicy,
    excludeFromSystemGesture: Boolean,
    clippingEnabled: Boolean
)
android
PopupProperties(
    focusable: Boolean,
    dismissOnBackPress: Boolean,
    dismissOnClickOutside: Boolean,
    securePolicy: SecureFlagPolicy,
    excludeFromSystemGesture: Boolean,
    clippingEnabled: Boolean,
    usePlatformDefaultWidth: Boolean
)

Constructs a PopupProperties with the given behaviors.

android

Public functions

open operator Boolean
equals(other: Any?)
android
open Int
android

Public properties

Boolean

Whether to allow the popup window to extend beyond the bounds of the screen.

Cmn
android
Boolean

Whether the popup can be dismissed by pressing the back or escape buttons on Android or the escape key on desktop.

Cmn
android
Boolean

Whether the popup can be dismissed by clicking outside the popup's bounds.

Cmn
android
Boolean

A flag to check whether to set the systemGestureExclusionRects.

android
Boolean

Whether the popup is focusable.

Cmn
android
SecureFlagPolicy

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

android
Boolean

Whether the width of the popup's content should be limited to the platform default, which is smaller than the screen width.

android

Public constructors

PopupProperties

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

PopupProperties

PopupProperties(
    flags: Int,
    inheritSecurePolicy: Boolean = true,
    dismissOnBackPress: Boolean = true,
    dismissOnClickOutside: Boolean = true,
    excludeFromSystemGesture: Boolean = true,
    usePlatformDefaultWidth: Boolean = false
)

PopupProperties

PopupProperties(
    focusable: Boolean = false,
    dismissOnBackPress: Boolean = true,
    dismissOnClickOutside: Boolean = true,
    securePolicy: SecureFlagPolicy = SecureFlagPolicy.Inherit,
    excludeFromSystemGesture: Boolean = true,
    clippingEnabled: Boolean = true
)

PopupProperties

PopupProperties(
    focusable: Boolean = false,
    dismissOnBackPress: Boolean = true,
    dismissOnClickOutside: Boolean = true,
    securePolicy: SecureFlagPolicy = SecureFlagPolicy.Inherit,
    excludeFromSystemGesture: Boolean = true,
    clippingEnabled: Boolean = true,
    usePlatformDefaultWidth: Boolean = false
)

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
focusable: Boolean = false

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

dismissOnBackPress: Boolean = true

Whether 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.

dismissOnClickOutside: Boolean = true

Whether the popup can be dismissed by clicking outside the popup's bounds. If true, clicking outside the popup will call onDismissRequest.

securePolicy: SecureFlagPolicy = SecureFlagPolicy.Inherit

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

excludeFromSystemGesture: Boolean = true

A flag to check whether to set the systemGestureExclusionRects. The default is true.

clippingEnabled: Boolean = true

Whether 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.

usePlatformDefaultWidth: Boolean = false

Whether the width of the popup's content should be limited to the platform default, which is smaller than the screen width.

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

Public properties

clippingEnabled

val clippingEnabledBoolean

Whether 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.

dismissOnBackPress

val dismissOnBackPressBoolean

Whether the popup can be dismissed by pressing the back or escape buttons on Android or the escape key on desktop. If true, pressing the back button 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.

dismissOnClickOutside

val dismissOnClickOutsideBoolean

Whether the popup can be dismissed by clicking outside the popup's bounds. If true, clicking outside the popup will call onDismissRequest.

excludeFromSystemGesture

val excludeFromSystemGestureBoolean

A flag to check whether to set the systemGestureExclusionRects. The default is true.

focusable

val focusableBoolean

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

securePolicy

val securePolicySecureFlagPolicy

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

usePlatformDefaultWidth

val usePlatformDefaultWidthBoolean

Whether the width of the popup's content should be limited to the platform default, which is smaller than the screen width.