Google is committed to advancing racial equity for Black communities. See how.

FloatProperty

abstract class FloatProperty<T : Any!> : Property<T, Float!>
kotlin.Any
   ↳ android.util.Property<T, kotlin.Float>
   ↳ androidx.core.animation.FloatProperty

An implementation of android.util.Property to be used specifically with fields of type float. This type-specific subclass enables performance benefit by allowing calls to a setValue() function that takes the primitive float type and avoids autoboxing and other overhead associated with the Float class.

Summary

Public constructors

<init>(@NonNull name: String)

A constructor that takes an identifying name for the float property.

A constructor that creates a float property instance with an empty name.

Public methods

Unit
set(@NonNull object: T, @NonNull value: Float)

abstract Unit
setValue(@NonNull object: T, value: Float)

A type-specific variant of set(Object, Float) that is faster when dealing with fields of type float.

Public constructors

<init>

FloatProperty(@NonNull name: String)

A constructor that takes an identifying name for the float property. This name will show up as a part of ObjectAnimator#getPropertyName() when the ObjectAnimator is created with a Property instance as the animation property. This name will also appear in systrace as a part of the animator name.

Parameters
name String: name to be used to identify the property

See Also

<init>

FloatProperty()

A constructor that creates a float property instance with an empty name. To create a named float property, see FloatProperty(String)

Public methods

set

fun set(
    @NonNull object: T,
    @NonNull value: Float
): Unit

setValue

abstract fun setValue(
    @NonNull object: T,
    value: Float
): Unit

A type-specific variant of set(Object, Float) that is faster when dealing with fields of type float.