FloatPropertyCompat
abstract class FloatPropertyCompat<T : Any!>
kotlin.Any | |
↳ | androidx.dynamicanimation.animation.FloatPropertyCompat |
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 FloatPropertyCompat#createFloatPropertyCompat(FloatProperty)
.
Summary
Public constructors | |
---|---|
A constructor that takes an identifying name. |
Public methods | |
---|---|
open static FloatPropertyCompat<T>! |
createFloatPropertyCompat(property: FloatProperty<T>!) Create a |
abstract Float |
getValue(object: T) Returns the current value that this property represents on the given |
abstract Unit |
Sets the value on |
Public constructors
Public methods
createFloatPropertyCompat
@RequiresApi(24) open static fun <T : Any!> createFloatPropertyCompat(property: FloatProperty<T>!): FloatPropertyCompat<T>!
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<T>!: FloatProperty instance to be wrapped |
<T> |
the class on which the Property is declared |
Return | |
---|---|
FloatPropertyCompat<T>! |
a new FloatPropertyCompat wrapper for the given FloatProperty object |
getValue
abstract fun getValue(object: T): Float
Returns the current value that this property represents on the given object
.
Parameters | |
---|---|
object |
T: object which this property represents |
Return | |
---|---|
Float |
the current property value of the given object |