# ConditionScopes.ConditionScope

# 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)

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/androidx/wear/protolayout/expression/ConditionScopes.ConditionScope "View this page in Java")


```
class ConditionScopes.ConditionScope<T : 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 functions                                                                     |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ConditionScopes.IfTrueScope](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/ConditionScopes.IfTrueScope)`<T!, RawT!>` | [use](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/ConditionScopes.ConditionScope#use(T))`(valueWhenTrue: T!)` Sets the value to use as the value when true in a conditional expression.       |
| [ConditionScopes.IfTrueScope](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/ConditionScopes.IfTrueScope)`<T!, RawT!>` | [use](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/ConditionScopes.ConditionScope#use(RawT))`(valueWhenTrue: RawT!)` Sets the value to use as the value when true in a conditional expression. |

## Public functions

### use

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

```
fun use(valueWhenTrue: T!): ConditionScopes.IfTrueScope<T!, RawT!>
```

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)  

```
fun use(valueWhenTrue: RawT!): ConditionScopes.IfTrueScope<T!, RawT!>
```

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