# ConditionScopes.ConditionScope

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

*** ** * ** ***


```
public class ConditionScopes.ConditionScope<T extends DynamicBuilders.DynamicType, RawT>
```

<br />

*** ** * ** ***

Condition scope to allow binding the true value in a onConditional expression. `RawT` is the native Java type that can be used when constructing a constant T (e.g. String for DynamicString).

## Summary

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/ConditionScopes.IfTrueScope<T, RawT>` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/ConditionScopes.ConditionScope#use(T)(T valueWhenTrue)` Sets the value to use as the value when true in a conditional expression. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/expression/ConditionScopes.IfTrueScope<T, RawT>` | `https://developer.android.com/reference/androidx/wear/protolayout/expression/ConditionScopes.ConditionScope#use(RawT)(RawT valueWhenTrue)` Sets the value to use as the value when true in a conditional expression. |

## Public methods

### use

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

```
public @NonNull ConditionScopes.IfTrueScope<T, RawT> use(T valueWhenTrue)
```

Sets the value to use as the value when true in a conditional expression.

### use

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

```
public @NonNull ConditionScopes.IfTrueScope<T, RawT> use(RawT valueWhenTrue)
```

Sets the value to use as the value when true in a conditional expression.