# ConditionScopes.IfTrueScope

# ConditionScopes.IfTrueScope

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.IfTrueScope)  
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.IfTrueScope "View this page in Java")

<br />

```
class ConditionScopes.IfTrueScope<T : DynamicBuilders.DynamicType?, RawT>
```

<br />

*** ** * ** ***

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

## Summary

| ### Public functions |
|----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `T!`                 | [elseUse](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/ConditionScopes.IfTrueScope#elseUse(T))`(valueWhenFalse: T!)` Sets the value to use as the value when false in a conditional expression.       |
| `T!`                 | [elseUse](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/ConditionScopes.IfTrueScope#elseUse(RawT))`(valueWhenFalse: RawT!)` Sets the value to use as the value when false in a conditional expression. |

## Public functions

### elseUse

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

```
fun elseUse(valueWhenFalse: T!): T!
```

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

### elseUse

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

```
fun elseUse(valueWhenFalse: RawT!): T!
```

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