# ClickableKt

Added in 1.3.0

*** ** * ** ***


```
public final class ClickableKt
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier` | `https://developer.android.com/reference/androidx/wear/protolayout/modifiers/ClickableKt#(androidx.wear.protolayout.modifiers.LayoutModifier).clickable(androidx.wear.protolayout.ModifiersBuilders.Clickable)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/ModifiersBuilders.Clickable clickable )` Adds the clickable property of the modified element. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier` | `https://developer.android.com/reference/androidx/wear/protolayout/modifiers/ClickableKt#(androidx.wear.protolayout.modifiers.LayoutModifier).clickable(androidx.wear.protolayout.ActionBuilders.Action,kotlin.String)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/ActionBuilders.Action action, https://developer.android.com/reference/java/lang/String.html id )` Adds the clickable property of the modified element. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/ModifiersBuilders.Clickable` | `https://developer.android.com/reference/androidx/wear/protolayout/modifiers/ClickableKt#clickable(androidx.wear.protolayout.ActionBuilders.Action,kotlin.String,kotlin.Float,kotlin.Float)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/ActionBuilders.Action action, https://developer.android.com/reference/java/lang/String.html id, @https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 300) @https://developer.android.com/reference/androidx/annotation/Dimension(unit = 0) float minClickableWidth, @https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 300) @https://developer.android.com/reference/androidx/annotation/Dimension(unit = 0) float minClickableHeight )` Creates a `https://developer.android.com/reference/androidx/wear/protolayout/ModifiersBuilders.Clickable` that allows the modified element to have actions associated with it, which will be executed when the element is tapped. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/ModifiersBuilders.Clickable` | `https://developer.android.com/reference/androidx/wear/protolayout/modifiers/ClickableKt#(androidx.wear.protolayout.ProtoLayoutScope).clickable(android.app.PendingIntent,kotlin.String,androidx.wear.protolayout.ActionBuilders.Action,kotlin.Float,kotlin.Float)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/ProtoLayoutScope receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/app/PendingIntent.html pendingIntent, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html id, https://developer.android.com/reference/androidx/wear/protolayout/ActionBuilders.Action fallbackAction, @https://developer.android.com/reference/androidx/annotation/Dimension(unit = 0) float minClickableWidth, @https://developer.android.com/reference/androidx/annotation/Dimension(unit = 0) float minClickableHeight )` Creates a `https://developer.android.com/reference/androidx/wear/protolayout/ModifiersBuilders.Clickable` that allows the modified element to have a `https://developer.android.com/reference/android/app/PendingIntent.html` associated with it, which will be sent when the element is tapped. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/ActionBuilders.LoadAction` | `https://developer.android.com/reference/androidx/wear/protolayout/modifiers/ClickableKt#loadAction(androidx.wear.protolayout.expression.DynamicDataMap)( @https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicDataMap requestedStateMap )` Creates an action used to load (or reload) the layout contents. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 300) https://developer.android.com/reference/androidx/wear/protolayout/modifiers/ClickableKt#(androidx.wear.protolayout.modifiers.LayoutModifier).minimumTouchTargetSize(kotlin.Float,kotlin.Float)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/modifiers/LayoutModifier receiver, @https://developer.android.com/reference/androidx/annotation/Dimension(unit = 0) float minWidth, @https://developer.android.com/reference/androidx/annotation/Dimension(unit = 0) float minHeight )` Sets the minimum width and height of the clickable area. |

## Public methods

### clickable

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/modifiers/Clickable.kt+function:clickable) Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.3.0)

```
public static final @NonNull LayoutModifier clickable(
    @NonNull LayoutModifier receiver,
    @NonNull ModifiersBuilders.Clickable clickable
)
```

Adds the clickable property of the modified element. It allows the modified element to have actions associated with it, which will be executed when the element is tapped.

### clickable

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/modifiers/Clickable.kt+function:clickable) Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.3.0)

```
public static final @NonNull LayoutModifier clickable(
    @NonNull LayoutModifier receiver,
    @NonNull ActionBuilders.Action action,
    String id
)
```

Adds the clickable property of the modified element. It allows the modified element to have actions associated with it, which will be executed when the element is tapped.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/ActionBuilders.Action action` | is triggered whenever the element is tapped. By default adds an empty `https://developer.android.com/reference/androidx/wear/protolayout/ActionBuilders.LoadAction`. |
| `https://developer.android.com/reference/java/lang/String.html id` | is the associated identifier for this clickable. This will be passed to the action handler. |

### clickable

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/modifiers/Clickable.kt+function:clickable) Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.3.0)

```
public static final @NonNull ModifiersBuilders.Clickable clickable(
    @NonNull ActionBuilders.Action action,
    String id,
    @RequiresSchemaVersion(major = 1, minor = 300) @Dimension(unit = 0) float minClickableWidth,
    @RequiresSchemaVersion(major = 1, minor = 300) @Dimension(unit = 0) float minClickableHeight
)
```

Creates a `https://developer.android.com/reference/androidx/wear/protolayout/ModifiersBuilders.Clickable` that allows the modified element to have actions associated with it, which will be executed when the element is tapped.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/protolayout/ActionBuilders.Action action` | is triggered whenever the element is tapped. By default adds an empty `https://developer.android.com/reference/androidx/wear/protolayout/ActionBuilders.LoadAction`. |
| `https://developer.android.com/reference/java/lang/String.html id` | is the associated identifier for this clickable. This will be passed to the action handler. |
| `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 300) @https://developer.android.com/reference/androidx/annotation/Dimension(unit = 0) float minClickableWidth` | of the clickable area. The default value is 48dp, following the Material design accessibility guideline. Note that this value does not affect the layout, so the minimum clickable width is not guaranteed unless there is enough space around the element within its parent bounds. |
| `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 300) @https://developer.android.com/reference/androidx/annotation/Dimension(unit = 0) float minClickableHeight` | of the clickable area. The default value is 48dp, following the Material design accessibility guideline. Note that this value does not affect the layout, so the minimum clickable height is not guaranteed unless there is enough space around the element within its parent bounds. |

### clickable

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/modifiers/Clickable.kt+function:clickable) Added in [1.4.2](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.4.2)

```
public static final @NonNull ModifiersBuilders.Clickable clickable(
    @NonNull ProtoLayoutScope receiver,
    @NonNull PendingIntent pendingIntent,
    @NonNull String id,
    ActionBuilders.Action fallbackAction,
    @Dimension(unit = 0) float minClickableWidth,
    @Dimension(unit = 0) float minClickableHeight
)
```

Creates a `https://developer.android.com/reference/androidx/wear/protolayout/ModifiersBuilders.Clickable` that allows the modified element to have a `https://developer.android.com/reference/android/app/PendingIntent.html` associated with it, which will be sent when the element is tapped.

This clickable requires to be created in a `https://developer.android.com/reference/androidx/wear/protolayout/ProtoLayoutScope` receiver scope which handles internal details of ProtoLayout layout and tiles. In Tiles cases, this scope object can be obtained via `androidx.wear.tiles.RequestBuilders#TileRequest.getScope`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/app/PendingIntent.html pendingIntent` | is sent when the element is tapped. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html id` | is the associated identifier for this clickable. This will be used to the identify the pendingIntent to send in the renderer. Within the same tile, this id must be unique among all pendingIntent clickables. |
| `https://developer.android.com/reference/androidx/wear/protolayout/ActionBuilders.Action fallbackAction` | The Action to use as a fallback when PendingIntent isn't supported by the ProtoLayout Renderer. |
| `@https://developer.android.com/reference/androidx/annotation/Dimension(unit = 0) float minClickableWidth` | of the clickable area. The default value is 48dp, following the Material design accessibility guideline. Note that this value does not affect the layout, so the minimum clickable width is not guaranteed unless there is enough space around the element within its parent bounds. |
| `@https://developer.android.com/reference/androidx/annotation/Dimension(unit = 0) float minClickableHeight` | of the clickable area. The default value is 48dp, following the Material design accessibility guideline. Note that this value does not affect the layout, so the minimum clickable height is not guaranteed unless there is enough space around the element within its parent bounds. |

### loadAction

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/modifiers/Clickable.kt+function:loadAction) Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.3.0)

```
public static final @NonNull ActionBuilders.LoadAction loadAction(
    @RequiresSchemaVersion(major = 1, minor = 200) DynamicDataMap requestedStateMap
)
```

Creates an action used to load (or reload) the layout contents.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/androidx/wear/protolayout/expression/DynamicDataMap requestedStateMap` | is the state associated with this action. This state will be passed to the action handler. |

### minimumTouchTargetSize

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/modifiers/Clickable.kt+function:minimumTouchTargetSize) Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.3.0)

```
@RequiresSchemaVersion(major = 1, minor = 300)
public static final @NonNull LayoutModifier minimumTouchTargetSize(
    @NonNull LayoutModifier receiver,
    @Dimension(unit = 0) float minWidth,
    @Dimension(unit = 0) float minHeight
)
```

Sets the minimum width and height of the clickable area. The default value is 48dp, following the Material design accessibility guideline. Note that this value does not affect the layout, so the minimum clickable width/height is not guaranteed unless there is enough space around the element within its parent bounds.