FloatPropertyCompat


public abstract class FloatPropertyCompat<T>

Known direct subclasses
DynamicAnimation.ViewProperty

ViewProperty holds the access of a property of a View.


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 and getter getValue 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.

Parameters
<T>

the class on which the Property is declared

Summary

Public constructors

A constructor that takes an identifying name.

Public methods

static FloatPropertyCompat<T>
@RequiresApi(value = 24)
<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.

Public constructors

FloatPropertyCompat

Added in 1.0.0
public FloatPropertyCompat(String name)

A constructor that takes an identifying name.

Public methods

createFloatPropertyCompat

Added in 1.0.0
@RequiresApi(value = 24)
public static FloatPropertyCompat<T> <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
<T>

the class on which the Property is declared

FloatProperty<T> property

FloatProperty instance to be wrapped

Returns
FloatPropertyCompat<T>

a new FloatPropertyCompat wrapper for the given FloatProperty object

getValue

Added in 1.0.0
public abstract float getValue(T object)

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

Parameters
T object

object which this property represents

Returns
float

the current property value of the given object

setValue

Added in 1.0.0
public abstract void setValue(T object, float value)

Sets the value on object which this property represents.

Parameters
T object

object which this property represents

float value

new value of the property