Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.
Android 0.0.0 Developer Preview
belongs to Maven artifact androidx.dynamicanimation:dynamicanimation:1.0.0-rc01

FloatPropertyCompat

public abstract class FloatPropertyCompat
extends Object

java.lang.Object
   ↳ androidx.dynamicanimation.animation.FloatPropertyCompat<T>


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) and getter getValue(Object) 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 instances can be converted to FloatPropertyCompat through createFloatPropertyCompat(FloatProperty).

Summary

Public constructors

FloatPropertyCompat(String name)

A constructor that takes an identifying name.

Public methods

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

Create a FloatPropertyCompat wrapper for a FloatProperty object.

abstract float getValue(T object)

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

abstract void setValue(T object, float value)

Sets the value on object which this property represents.

Inherited methods

Public constructors

FloatPropertyCompat

public FloatPropertyCompat (String name)

A constructor that takes an identifying name.

Parameters
name String

Public methods

createFloatPropertyCompat

public static FloatPropertyCompat<T> createFloatPropertyCompat (FloatProperty<T> property)

Create a FloatPropertyCompat wrapper for a FloatProperty object. The new FloatPropertyCompat instance will access and modify the property value of FloatProperty through the FloatProperty instance's setter and getter.

Parameters
property FloatProperty: FloatProperty instance to be wrapped

Returns
FloatPropertyCompat<T> a new FloatPropertyCompat wrapper for the given FloatProperty object

getValue

public abstract float getValue (T object)

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

Parameters
object T: object which this property represents

Returns
float the current property value of the given object

setValue

public abstract void setValue (T object, 
                float value)

Sets the value on object which this property represents.

Parameters
object T: object which this property represents

value float: new value of the property