# FloatPropertyCompat

added in[version 25.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:support-dynamic-animation:28.0.0-alpha1  
Summary:[Ctors](https://developer.android.com/reference/android/support/animation/FloatPropertyCompat#pubctors)\|[Methods](https://developer.android.com/reference/android/support/animation/FloatPropertyCompat#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/animation/FloatPropertyCompat#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/animation/FloatPropertyCompat#)  

# FloatPropertyCompat

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public


abstract
class
FloatPropertyCompat
`  
`

extends Object


``


`

|---|----------------------------------------------------|
| java.lang.Object                                      ||
| ↳ | android.support.animation.FloatPropertyCompat\<T\> |

|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/animation/FloatPropertyCompat#)Known Direct Subclasses [DynamicAnimation.ViewProperty](https://developer.android.com/reference/android/support/animation/DynamicAnimation.ViewProperty) |----------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------| | [DynamicAnimation.ViewProperty](https://developer.android.com/reference/android/support/animation/DynamicAnimation.ViewProperty) | ViewProperty holds the access of a property of a[View](https://developer.android.com/reference/android/view/View.html). | |

<br />

*** ** * ** ***

<br />

FloatPropertyCompat is an abstraction that can be used to represent a mutable float value that is held in a host object. To access this float value,[setValue(Object, float)](https://developer.android.com/reference/android/support/animation/FloatPropertyCompat#setValue(T, float))and getter[getValue(Object)](https://developer.android.com/reference/android/support/animation/FloatPropertyCompat#getValue(T))need to be implemented. Both the setter and the getter take the primitive`float`type and avoids autoboxing and other overhead associated with the`Float`class.

For API 24 and later,[FloatProperty](https://developer.android.com/reference/android/util/FloatProperty.html)instances can be converted to[FloatPropertyCompat](https://developer.android.com/reference/android/support/animation/FloatPropertyCompat)through[createFloatPropertyCompat(FloatProperty)](https://developer.android.com/reference/android/support/animation/FloatPropertyCompat#createFloatPropertyCompat(android.util.FloatProperty<T>)).

## Summary

|                                                                                                ### Public constructors                                                                                                 ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[FloatPropertyCompat](https://developer.android.com/reference/android/support/animation/FloatPropertyCompat#FloatPropertyCompat(java.lang.String))`(String name) ` A constructor that takes an identifying name. |

|                                                                                                                                                                                                                                                                                                                     ### Public methods                                                                                                                                                                                                                                                                                                                      ||
|---------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` static <T> `[FloatPropertyCompat](https://developer.android.com/reference/android/support/animation/FloatPropertyCompat)`<T>` | ` `[createFloatPropertyCompat](https://developer.android.com/reference/android/support/animation/FloatPropertyCompat#createFloatPropertyCompat(android.util.FloatProperty<T>))`(`[FloatProperty](https://developer.android.com/reference/android/util/FloatProperty.html)`<T> property) ` Create a[FloatPropertyCompat](https://developer.android.com/reference/android/support/animation/FloatPropertyCompat)wrapper for a[FloatProperty](https://developer.android.com/reference/android/util/FloatProperty.html)object. |
| ` abstract float`                                                                                                               | ` `[getValue](https://developer.android.com/reference/android/support/animation/FloatPropertyCompat#getValue(T))`(T object) ` Returns the current value that this property represents on the given`object`.                                                                                                                                                                                                                                                                                                                |
| ` abstract void`                                                                                                                | ` `[setValue](https://developer.android.com/reference/android/support/animation/FloatPropertyCompat#setValue(T, float))`(T object, float value) ` Sets the value on`object`which this property represents.                                                                                                                                                                                                                                                                                                                 |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/animation/FloatPropertyCompat#)From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Public constructors

### FloatPropertyCompat

added in[version 25.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
FloatPropertyCompat (String name)
```

A constructor that takes an identifying name.

<br />

|       Parameters        ||
|--------|-----------------|
| `name` | `String` <br /> |

## Public methods

### createFloatPropertyCompat

added in[version 25.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
FloatPropertyCompat<T> createFloatPropertyCompat (FloatProperty<T> property)
```

Create a[FloatPropertyCompat](https://developer.android.com/reference/android/support/animation/FloatPropertyCompat)wrapper for a[FloatProperty](https://developer.android.com/reference/android/util/FloatProperty.html)object. The new[FloatPropertyCompat](https://developer.android.com/reference/android/support/animation/FloatPropertyCompat)instance will access and modify the property value of[FloatProperty](https://developer.android.com/reference/android/util/FloatProperty.html)through the[FloatProperty](https://developer.android.com/reference/android/util/FloatProperty.html)instance's setter and getter.

<br />

|                                Parameters                                ||
|------------|--------------------------------------------------------------|
| `property` | `FloatProperty`: FloatProperty instance to be wrapped <br /> |

|                                                                                                                                                                            Returns                                                                                                                                                                             ||
|-------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [FloatPropertyCompat](https://developer.android.com/reference/android/support/animation/FloatPropertyCompat)`<T>` | a new[FloatPropertyCompat](https://developer.android.com/reference/android/support/animation/FloatPropertyCompat)wrapper for the given[FloatProperty](https://developer.android.com/reference/android/util/FloatProperty.html)object <br /> |

### getValue

added in[version 25.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
float getValue (T object)
```

Returns the current value that this property represents on the given`object`.

<br />

|                         Parameters                          ||
|----------|---------------------------------------------------|
| `object` | `T`: object which this property represents <br /> |

|                            Returns                             ||
|---------|-------------------------------------------------------|
| `float` | the current property value of the given object <br /> |

### setValue

added in[version 25.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void setValue (T object, 
                float value)
```

Sets the value on`object`which this property represents.

<br />

|                         Parameters                          ||
|----------|---------------------------------------------------|
| `object` | `T`: object which this property represents <br /> |
| `value`  | `float`: new value of the property <br />         |

-

  ## Interfaces

  - [DynamicAnimation.OnAnimationEndListener](https://developer.android.com/reference/android/support/animation/DynamicAnimation.OnAnimationEndListener)
  - [DynamicAnimation.OnAnimationUpdateListener](https://developer.android.com/reference/android/support/animation/DynamicAnimation.OnAnimationUpdateListener)
-

  ## Classes

  - [DynamicAnimation](https://developer.android.com/reference/android/support/animation/DynamicAnimation)
  - [DynamicAnimation.ViewProperty](https://developer.android.com/reference/android/support/animation/DynamicAnimation.ViewProperty)
  - [FlingAnimation](https://developer.android.com/reference/android/support/animation/FlingAnimation)
  - [FloatPropertyCompat](https://developer.android.com/reference/android/support/animation/FloatPropertyCompat)
  - [FloatValueHolder](https://developer.android.com/reference/android/support/animation/FloatValueHolder)
  - [SpringAnimation](https://developer.android.com/reference/android/support/animation/SpringAnimation)
  - [SpringForce](https://developer.android.com/reference/android/support/animation/SpringForce)