# FloatProperty

Artifact: [androidx.core:core-animation](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/animation/FloatProperty.java+class:androidx.core.animation.FloatProperty) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/core#1.0.0)

*** ** * ** ***


```
abstract class FloatProperty<T> : Property<T!, Float!>
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [android.util.Property](https://developer.android.com/reference/android/util/Property.html)\<T!, [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)!\> ||
|   | ↳ | [androidx.core.animation.FloatProperty](https://developer.android.com/reference/kotlin/androidx/core/animation/FloatProperty) |

*** ** * ** ***

An implementation of `https://developer.android.com/reference/android/util/Property.html` to be used specifically with fields of type `float`. This type-specific subclass enables performance benefit by allowing calls to a `https://developer.android.com/reference/kotlin/androidx/core/animation/FloatProperty#setValue(T,float)` function that takes the primitive `float` type and avoids autoboxing and other overhead associated with the `Float` class.

| Parameters |
|---|---|
| `<T>` | The class on which the Property is declared. |

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/core/animation/FloatProperty#FloatProperty()()` A constructor that creates a float property instance with an empty name. |
| `https://developer.android.com/reference/kotlin/androidx/core/animation/FloatProperty#FloatProperty(java.lang.String)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` A constructor that takes an identifying name for the float property. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/animation/FloatProperty#set(T,java.lang.Float)(object: T, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` |
| `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/animation/FloatProperty#setValue(T,float)(object: T, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` A type-specific variant of `https://developer.android.com/reference/kotlin/androidx/core/animation/FloatProperty#set(T,java.lang.Float)` that is faster when dealing with fields of type `float`. |

### Inherited functions

From [android.util.Property](https://developer.android.com/reference/android/util/Property.html) `abstract V!` `https://developer.android.com/reference/android/util/Property.html#get(T)(p: T!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` `https://developer.android.com/reference/android/util/Property.html#getName()()` `https://developer.android.com/reference/java/lang/Class.html<V!>!` `https://developer.android.com/reference/android/util/Property.html#getType()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/util/Property.html#isReadOnly()()` `java-static https://developer.android.com/reference/android/util/Property.html<T!, V!>!` `<T, V> https://developer.android.com/reference/android/util/Property.html#of(java.lang.Class&lt;T&gt;, java.lang.Class&lt;V&gt;, java.lang.String)(hostType: https://developer.android.com/reference/java/lang/Class.html<T!>!, valueType: https://developer.android.com/reference/java/lang/Class.html<V!>!, name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)`

## Public constructors

### FloatProperty

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

```
FloatProperty()
```

A constructor that creates a float property instance with an empty name. To create a named float property, see `https://developer.android.com/reference/kotlin/androidx/core/animation/FloatProperty#FloatProperty(java.lang.String)`

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/core/animation/FloatProperty#FloatProperty(java.lang.String)` |   |

### FloatProperty

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

```
FloatProperty(name: String)
```

A constructor that takes an identifying name for the float property. This name will show up as a part of `https://developer.android.com/reference/kotlin/androidx/core/animation/ObjectAnimator#getPropertyName()` when the `https://developer.android.com/reference/kotlin/androidx/core/animation/ObjectAnimator` is created with a `https://developer.android.com/reference/android/util/Property.html` instance as the animation property. This name will also appear in systrace as a part of the animator name.

| Parameters |
|---|---|
| `name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | name to be used to identify the property |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/core/animation/FloatProperty#FloatProperty()` |   |

## Public functions

### set

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

```
fun set(object: T, value: Float): Unit
```

### setValue

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

```
abstract fun setValue(object: T, value: Float): Unit
```

A type-specific variant of `https://developer.android.com/reference/kotlin/androidx/core/animation/FloatProperty#set(T,java.lang.Float)` that is faster when dealing with fields of type `float`.