Android 12 Developer Preview is here! Try it out, and give us your feedback!

PopupProperties

@Immutable class PopupProperties
kotlin.Any
   ↳ androidx.compose.ui.window.PopupProperties

Properties used to customize the behavior of a Popup.

Summary

Public constructors
<init>(focusable: Boolean = false, dismissOnBackPress: Boolean = true, dismissOnClickOutside: Boolean = true, securePolicy: SecureFlagPolicy = SecureFlagPolicy.Inherit)

Properties used to customize the behavior of a Popup.

Public methods
Boolean
equals(other: Any?)

Int

Properties
Boolean

Whether the popup can be dismissed by pressing the back button.

Boolean

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

Boolean

Whether the popup is focusable.

SecureFlagPolicy

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

Public constructors

<init>

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

Properties used to customize the behavior of a Popup.

Public methods

equals

fun equals(other: Any?): Boolean

hashCode

fun hashCode(): Int

Properties

dismissOnBackPress

val dismissOnBackPress: Boolean

Whether the popup can be dismissed by pressing the back button. 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 dismissOnClickOutside: Boolean

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

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

focusable

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.

securePolicy

val securePolicy: SecureFlagPolicy

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