# TypeBuilders.FloatProp.Builder

# TypeBuilders.FloatProp.Builder

Artifact:[androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout)  
[View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/TypeBuilders.java+class:androidx.wear.protolayout.TypeBuilders.FloatProp.Builder)  
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/TypeBuilders.FloatProp.Builder "View this page in Java")

<br />

```
class TypeBuilders.FloatProp.Builder
```

<br />

*** ** * ** ***

Builder for[FloatProp](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/TypeBuilders.FloatProp)

## Summary

|                                                                                                                                                                                         ### Public constructors                                                                                                                                                                                          |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ~~[Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/TypeBuilders.FloatProp.Builder#Builder())~~`()` **This function is deprecated.** use[Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/TypeBuilders.FloatProp.Builder#Builder(float)) <br />                                                                                        |
| [Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/TypeBuilders.FloatProp.Builder#Builder(float))`(staticValue: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Creates an instance of[Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/TypeBuilders.FloatProp.Builder)from the given static value. |

|                                                           ### Public functions                                                            |
|-------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [TypeBuilders.FloatProp](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/TypeBuilders.FloatProp)                 | [build](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/TypeBuilders.FloatProp.Builder#build())`()` Builds an instance from accumulated values.                                                                                                                                                                                                                                                                                                                                                                                                  |
| [TypeBuilders.FloatProp.Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/TypeBuilders.FloatProp.Builder) | `@`[RequiresSchemaVersion](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion)`(major = 1, minor = 200)` [setDynamicValue](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/TypeBuilders.FloatProp.Builder#setDynamicValue(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat))`(dynamicValue: `[DynamicBuilders.DynamicFloat](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/DynamicBuilders.DynamicFloat)`)` Sets the dynamic value. |
| [TypeBuilders.FloatProp.Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/TypeBuilders.FloatProp.Builder) | `@`[RequiresSchemaVersion](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/expression/RequiresSchemaVersion)`(major = 1, minor = 0)` [setValue](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/TypeBuilders.FloatProp.Builder#setValue(float))`(value: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Sets the static value.                                                                                                                                                      |

## Public constructors

### Builder

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

```
[Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/TypeBuilders.FloatProp.Builder#Builder())()
```
| **This function is deprecated.**   
|
| use[Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/TypeBuilders.FloatProp.Builder#Builder(float))

Creates an instance of[Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/TypeBuilders.FloatProp.Builder).  

### Builder

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

```
Builder(staticValue: Float)
```

Creates an instance of[Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/TypeBuilders.FloatProp.Builder)from the given static value.[setDynamicValue](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/TypeBuilders.FloatProp.Builder#setDynamicValue(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat))can be used to provide a dynamic value.  

## Public functions

### build

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

```
fun build(): TypeBuilders.FloatProp
```

Builds an instance from accumulated values.  

|                                                     Throws                                                      |
|-----------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [java.lang.IllegalStateException](https://developer.android.com/reference/java/lang/IllegalStateException.html) | if a dynamic value is set using[setDynamicValue](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/TypeBuilders.FloatProp.Builder#setDynamicValue(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat))but neither[Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/TypeBuilders.FloatProp.Builder#Builder(float))nor[setValue](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/TypeBuilders.FloatProp.Builder#setValue(float))is used to provide a static value. |

### setDynamicValue

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

```
@RequiresSchemaVersion(major = 1, minor = 200)
fun setDynamicValue(dynamicValue: DynamicBuilders.DynamicFloat): TypeBuilders.FloatProp.Builder
```

Sets the dynamic value. Note that when setting this value, the static value is still required to be set (with either[Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/TypeBuilders.FloatProp.Builder#Builder(float))or[setValue](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/TypeBuilders.FloatProp.Builder#setValue(float))) to support older renderers that only read the static value. If`dynamicValue `has an invalid result, the provided static value will be used instead.  

### setValue

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

```
@RequiresSchemaVersion(major = 1, minor = 0)
fun setValue(value: Float): TypeBuilders.FloatProp.Builder
```

Sets the static value. If a dynamic value is also set and the renderer supports dynamic values for the corresponding field, this static value will be ignored. If the static value is not specified, zero will be used instead.