# EventBuilders.TileInteractionEvent

# EventBuilders.TileInteractionEvent

Artifact:[androidx.wear.tiles:tiles](https://developer.android.com/jetpack/androidx/releases/wear-tiles)  
[View Source](https://cs.android.com/search?q=file:androidx/wear/tiles/EventBuilders.java+class:androidx.wear.tiles.EventBuilders.TileInteractionEvent)  
Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.4.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/wear/tiles/EventBuilders.TileInteractionEvent "View this page in Java")

<br />

```
@RequiresSchemaVersion(major = 1, minor = 400)
class EventBuilders.TileInteractionEvent
```

<br />

*** ** * ** ***

Event reported when a user interacts with a tile (e.g. entering or leaving a tile).

## Summary

|                                                                                                                                               ### Nested types                                                                                                                                               |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[EventBuilders.TileInteractionEvent.Builder](https://developer.android.com/reference/kotlin/androidx/wear/tiles/EventBuilders.TileInteractionEvent.Builder) Builder for[TileInteractionEvent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/EventBuilders.TileInteractionEvent) |

|                                    ### Constants                                    |
|-------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [ENTER](https://developer.android.com/reference/kotlin/androidx/wear/tiles/EventBuilders.TileInteractionEvent#ENTER())` = 1` User entered the tile. |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [LEAVE](https://developer.android.com/reference/kotlin/androidx/wear/tiles/EventBuilders.TileInteractionEvent#LEAVE())` = 2` User left the tile.    |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [UNKNOWN](https://developer.android.com/reference/kotlin/androidx/wear/tiles/EventBuilders.TileInteractionEvent#UNKNOWN())` = 0` Unknown type       |

|                               ### Public functions                                |
|-----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)       | [getEventType](https://developer.android.com/reference/kotlin/androidx/wear/tiles/EventBuilders.TileInteractionEvent#getEventType())`()` Gets the type of the[TileInteractionEvent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/EventBuilders.TileInteractionEvent). |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)       | [getTileId](https://developer.android.com/reference/kotlin/androidx/wear/tiles/EventBuilders.TileInteractionEvent#getTileId())`()` Gets instance ID of the tile, allocated when the tile instance is added to the carousel.                                                                 |
| [Instant](https://developer.android.com/reference/java/time/Instant.html)         | [getTimestamp](https://developer.android.com/reference/kotlin/androidx/wear/tiles/EventBuilders.TileInteractionEvent#getTimestamp())`()` Gets the timestamp of when the interaction was reported.                                                                                           |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | [toString](https://developer.android.com/reference/kotlin/androidx/wear/tiles/EventBuilders.TileInteractionEvent#toString())`()`                                                                                                                                                            |

## Constants

### ENTER

Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.4.0)  

```
const val ENTER = 1: Int
```

User entered the tile.  

### LEAVE

Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.4.0)  

```
const val LEAVE = 2: Int
```

User left the tile.  

### UNKNOWN

Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.4.0)  

```
const val UNKNOWN = 0: Int
```

Unknown type  

## Public functions

### getEventType

Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.4.0)  

```
fun getEventType(): Int
```

Gets the type of the[TileInteractionEvent](https://developer.android.com/reference/kotlin/androidx/wear/tiles/EventBuilders.TileInteractionEvent).  

### getTileId

Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.4.0)  

```
fun getTileId(): Int
```

Gets instance ID of the tile, allocated when the tile instance is added to the carousel. This ID will remain the same for this tile instance as long it is not removed from the carousel.  

### getTimestamp

Added in[1.4.0](https://developer.android.com/jetpack/androidx/releases/wear-tiles#1.4.0)  

```
fun getTimestamp(): Instant
```

Gets the timestamp of when the interaction was reported. Defaults to[now](https://developer.android.com/reference/java/time/Instant.html#now())(Created at the time of[Builder](https://developer.android.com/reference/kotlin/androidx/wear/tiles/EventBuilders.TileInteractionEvent.Builder#Builder(int,int))constructor call) if not provided.  

### toString

```
fun toString(): String
```