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

*** ** * ** ***


```
public abstract class FloatProperty<T> extends Property<T, Float>
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [android.util.Property](https://developer.android.com/reference/android/util/Property.html)\<T, [Float](https://developer.android.com/reference/java/lang/Float.html)\> ||
|   | ↳ | [androidx.core.animation.FloatProperty](https://developer.android.com/reference/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/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/androidx/core/animation/FloatProperty#FloatProperty()()` A constructor that creates a float property instance with an empty name. |
| `https://developer.android.com/reference/androidx/core/animation/FloatProperty#FloatProperty(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html name)` A constructor that takes an identifying name for the float property. |

| ### Public methods |
|---|---|
| `final void` | `https://developer.android.com/reference/androidx/core/animation/FloatProperty#set(T,java.lang.Float)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T object, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/Float.html value)` |
| `abstract void` | `https://developer.android.com/reference/androidx/core/animation/FloatProperty#setValue(T,float)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T object, float value)` A type-specific variant of `https://developer.android.com/reference/androidx/core/animation/FloatProperty#set(T,java.lang.Float)` that is faster when dealing with fields of type `float`. |

### Inherited methods

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)(T p)` `https://developer.android.com/reference/java/lang/String.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()()` `boolean` `https://developer.android.com/reference/android/util/Property.html#isReadOnly()()` `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)(https://developer.android.com/reference/java/lang/Class.html<T> hostType, https://developer.android.com/reference/java/lang/Class.html<V> valueType, https://developer.android.com/reference/java/lang/String.html name)`

## Public constructors

### FloatProperty

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

```
public 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/androidx/core/animation/FloatProperty#FloatProperty(java.lang.String)`

| See also |
|---|---|
| `https://developer.android.com/reference/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)

```
public FloatProperty(@NonNull String name)
```

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/androidx/core/animation/ObjectAnimator#getPropertyName()` when the `https://developer.android.com/reference/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 |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html name` | name to be used to identify the property |

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

## Public methods

### set

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

```
public final void set(@NonNull T object, @NonNull Float value)
```

### setValue

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

```
public abstract void setValue(@NonNull T object, float value)
```

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