# TileRenderer.Builder

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

*** ** * ** ***


```
public final class TileRenderer.Builder
```

<br />

*** ** * ** ***

Builder for `https://developer.android.com/reference/androidx/wear/tiles/renderer/TileRenderer`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/wear/tiles/renderer/TileRenderer.Builder#Builder(android.content.Context,java.util.concurrent.Executor,java.util.function.Consumer<androidx.wear.protolayout.StateBuilders.State>)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html uiContext, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/concurrent/Executor.html loadActionExecutor, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/function/Consumer.html<https://developer.android.com/reference/androidx/wear/protolayout/StateBuilders.State> loadActionListener )` Builder for the `https://developer.android.com/reference/androidx/wear/tiles/renderer/TileRenderer` class. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/renderer/TileRenderer.Builder` | `https://developer.android.com/reference/androidx/wear/tiles/renderer/TileRenderer.Builder#addPlatformDataProvider(androidx.wear.protolayout.expression.pipeline.PlatformDataProvider,androidx.wear.protolayout.expression.PlatformDataKey<?>...)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/PlatformDataProvider platformDataProvider, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html PlatformDataKey[] supportedKeys )` Adds a `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/PlatformDataProvider` that will be registered for the given ` supportedKeys`. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/renderer/TileRenderer` | `https://developer.android.com/reference/androidx/wear/tiles/renderer/TileRenderer.Builder#build()()` Builds `https://developer.android.com/reference/androidx/wear/tiles/renderer/TileRenderer` object. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/tiles/renderer/TileRenderer.Builder` | `https://developer.android.com/reference/androidx/wear/tiles/renderer/TileRenderer.Builder#setTilesTheme(int)(@https://developer.android.com/reference/androidx/annotation/StyleRes int tilesTheme)` Sets the theme to use for this Tile instance. |

## Public constructors

### Builder

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

```
public Builder(
    @NonNull Context uiContext,
    @NonNull Executor loadActionExecutor,
    @NonNull Consumer<StateBuilders.State> loadActionListener
)
```

Builder for the `https://developer.android.com/reference/androidx/wear/tiles/renderer/TileRenderer` class.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html uiContext` | A `https://developer.android.com/reference/android/content/Context.html` suitable for interacting with the UI. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/concurrent/Executor.html loadActionExecutor` | Executor for `loadActionListener`. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/function/Consumer.html<https://developer.android.com/reference/androidx/wear/protolayout/StateBuilders.State> loadActionListener` | Listener for clicks that will cause the contents to be reloaded. |

## Public methods

### addPlatformDataProvider

```
public @NonNull TileRenderer.Builder addPlatformDataProvider(
    @NonNull PlatformDataProvider platformDataProvider,
    @NonNull PlatformDataKey[] supportedKeys
)
```

Adds a `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/PlatformDataProvider` that will be registered for the given `
supportedKeys`. Adding the same `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/PlatformDataProvider` several times will override previous entries instead of adding multiple entries.

### build

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

```
public @NonNull TileRenderer build()
```

Builds `https://developer.android.com/reference/androidx/wear/tiles/renderer/TileRenderer` object.

### setTilesTheme

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

```
public @NonNull TileRenderer.Builder setTilesTheme(@StyleRes int tilesTheme)
```

Sets the theme to use for this Tile instance. This can be used to customise things like the default font family. If not set, zero (default theme) will be used.