interactable

fun Modifier.interactable(enabled: Boolean = true, selected: Boolean? = null, style: Style? = null, interactionSource: MutableInteractionSource? = null, role: Role? = null, onLongClick: () -> Unit? = null, onClick: () -> Unit): Modifier

Interop Modifier to support either Modifier.selectable or Modifier.clickable, applying the correct modifier based on the requirement for hardware input. For example if a Tv device is detected it adds support for hardware clicks from remote controls. This has the added support for Style, applying interactionStyle to update the component based on the current InteractionSource state.

Since

0.3.1

Parameters

enabled

Whether the click action handling is enabled.

selected

Optional property to set the selected state. Setting this to a value will enable selectable support.

style

Optional Style to apply with the interactable.

interactionSource

The interaction source to emit interaction events to.

role

The Role of the associated user interface element, typically used by Accessiblity services.

onLongClick

Optional callback to handle long click events.

onClick

Callback when the element is clicked.


fun Modifier.interactable(enabled: Boolean = true, selected: Boolean? = null, style: StyleScope.() -> Unit? = null, interactionSource: MutableInteractionSource? = null, role: Role? = null, onLongClick: () -> Unit? = null, onClick: () -> Unit): Modifier

Interop Modifier to support either Modifier.selectable or Modifier.clickable, applying the correct modifier based on the requirement for hardware input. For example if a Tv device is detected it adds support for hardware clicks from remote controls. This has the added support for Style, applying interactionStyle to update the component based on the current InteractionSource state.

Since

0.3.4

Parameters

enabled

Whether the click action handling is enabled.

selected

Optional property to set the selected state. Setting this to a value will enable selectable support.

style

Optional Style block to apply with the interactable.

interactionSource

The interaction source to emit interaction events to.

role

The Role of the associated user interface element, typically used by Accessiblity services.

onLongClick

Optional callback to handle long click events.

onClick

Callback when the element is clicked.