# DynamicTypeEvaluator

Artifact: [androidx.wear.protolayout:protolayout-expression-pipeline](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/expression/pipeline/DynamicTypeEvaluator.java+class:androidx.wear.protolayout.expression.pipeline.DynamicTypeEvaluator) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

*** ** * ** ***


```
public class DynamicTypeEvaluator
```

<br />

*** ** * ** ***

Evaluates protolayout dynamic types.

Given a dynamic ProtoLayout data source, this builds up a sequence of `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicDataNode` instances, which can source the required data, and transform it into its final form.

Data source can include animations which will then emit value transitions.

In order to evaluate dynamic types, the caller needs to create a `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeBindingRequest`, bind it using `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeEvaluator#bind(androidx.wear.protolayout.expression.pipeline.DynamicTypeBindingRequest)` method and then call `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/BoundDynamicType#startEvaluation()` on the resulted `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/BoundDynamicType` to start evaluation. Starting evaluation can be done for batches of dynamic types.

It's the callers responsibility to destroy those dynamic types after use, with `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/BoundDynamicType#close()`.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeEvaluator.Config` Configuration for creating `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeEvaluator`. |
| `public final class https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeEvaluator.Config.Builder` Builds a `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeEvaluator.Config`. |
| `public class https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeEvaluator.EvaluationException extends https://developer.android.com/reference/java/lang/Exception.html` Exception thrown when the binding of a `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeBindingRequest` fails. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeEvaluator#DynamicTypeEvaluator(androidx.wear.protolayout.expression.pipeline.DynamicTypeEvaluator.Config)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeEvaluator.Config config)` Constructs a `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeEvaluator`. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/BoundDynamicType` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeEvaluator#bind(androidx.wear.protolayout.expression.pipeline.DynamicTypeBindingRequest)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeBindingRequest request)` Binds a `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeBindingRequest`. |

## Public constructors

### DynamicTypeEvaluator

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

```
public DynamicTypeEvaluator(@NonNull DynamicTypeEvaluator.Config config)
```

Constructs a `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeEvaluator`.

## Public methods

### bind

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

```
public @NonNull BoundDynamicType bind(@NonNull DynamicTypeBindingRequest request)
```

Binds a `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeBindingRequest`.

Evaluation of this request will start when `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/BoundDynamicType#startEvaluation()` is called on the returned object.

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeEvaluator.EvaluationException` | when `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/QuotaManager` fails to allocate enough quota to bind the `https://developer.android.com/reference/androidx/wear/protolayout/expression/pipeline/DynamicTypeBindingRequest`. |