Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

FloatProperty

open class FloatProperty : Property<Parallax<Property<*, *>!>!, Float!>
kotlin.Any
   ↳ android.util.Property<androidx.leanback.widget.Parallax<android.util.Property<*, *>>, kotlin.Float>
   ↳ androidx.leanback.widget.Parallax.FloatProperty

FloatProperty provide access to an index based integer type property inside Parallax. The FloatProperty typically represents UI element position inside Parallax.

Summary

Constants

static Float

Property value is unknown and it's larger than Parallax#getMaxValue().

static Float

Property value is unknown and it's smaller than minimal value of Parallax.

Public constructors

<init>(name: String!, index: Int)

Constructor.

Public methods

Parallax.PropertyMarkerValue<Any!>!
at(offsetValue: Float, fractionOfMaxParentVisibleSize: Float)

Create an PropertyMarkerValue object by multiplying the fraction with Parallax#getMaxValue() and adding offsetValue to it.

Parallax.PropertyMarkerValue<Any!>!
atAbsolute(markerValue: Float)

Creates an PropertyMarkerValue object for the absolute marker value.

Parallax.PropertyMarkerValue<Any!>!
atFraction(fractionOfMaxParentVisibleSize: Float)

Creates an PropertyMarkerValue object for a fraction of Parallax#getMaxValue().

Parallax.PropertyMarkerValue<Any!>!

Creates an PropertyMarkerValue object for the marker value representing Parallax#getMaxValue().

Parallax.PropertyMarkerValue<Any!>!

Creates an PropertyMarkerValue object for the marker value representing 0.

Float!
get(object: Parallax<Property<*, *>!>!)

Int

Float
getValue(object: Parallax<Property<*, *>!>!)

Fast version of get() method that returns a primitive int value of the Property.

Unit
set(object: Parallax<Property<*, *>!>!, value: Float!)

Unit
setValue(object: Parallax<Property<*, *>!>!, value: Float)

Fast version of set() method that takes a primitive float value into the Property.

Constants

UNKNOWN_AFTER

static val UNKNOWN_AFTER: Float

Property value is unknown and it's larger than Parallax#getMaxValue(). For example if a child is not created and after the last visible child of RecyclerView.

Value: Float.MAX_VALUE

UNKNOWN_BEFORE

static val UNKNOWN_BEFORE: Float

Property value is unknown and it's smaller than minimal value of Parallax. For example if a child is not created and before the first visible child of RecyclerView.

Value: -Float.MAX_VALUE

Public constructors

<init>

FloatProperty(name: String!, index: Int)

Constructor.

Parameters
name String!: Name of this Property.
index String!: Index of this Property inside Parallax.

Public methods

at

fun at(offsetValue: Float, fractionOfMaxParentVisibleSize: Float): Parallax.PropertyMarkerValue<Any!>!

Create an PropertyMarkerValue object by multiplying the fraction with Parallax#getMaxValue() and adding offsetValue to it.

Parameters
offsetValue Float: An offset float value to be added to marker value.
fractionOfMaxParentVisibleSize Float: 0 to 1 fraction to multiply with Parallax#getMaxValue() for the marker value.
Return
Parallax.PropertyMarkerValue<Any!>!: A new PropertyMarkerValue object.

atAbsolute

fun atAbsolute(markerValue: Float): Parallax.PropertyMarkerValue<Any!>!

Creates an PropertyMarkerValue object for the absolute marker value.

Parameters
markerValue Float: The float marker value.
Return
Parallax.PropertyMarkerValue<Any!>!: A new PropertyMarkerValue object.

atFraction

fun atFraction(fractionOfMaxParentVisibleSize: Float): Parallax.PropertyMarkerValue<Any!>!

Creates an PropertyMarkerValue object for a fraction of Parallax#getMaxValue().

Parameters
fractionOfMaxParentVisibleSize Float: 0 to 1 fraction to multiply with Parallax#getMaxValue() for the marker value.
Return
Parallax.PropertyMarkerValue<Any!>!: A new PropertyMarkerValue object.

atMax

fun atMax(): Parallax.PropertyMarkerValue<Any!>!

Creates an PropertyMarkerValue object for the marker value representing Parallax#getMaxValue().

Return
Parallax.PropertyMarkerValue<Any!>!: A new PropertyMarkerValue object.

atMin

fun atMin(): Parallax.PropertyMarkerValue<Any!>!

Creates an PropertyMarkerValue object for the marker value representing 0.

Return
Parallax.PropertyMarkerValue<Any!>!: A new PropertyMarkerValue object.

get

fun get(object: Parallax<Property<*, *>!>!): Float!

getIndex

fun getIndex(): Int
Return
Int: Index of this Property in Parallax.

getValue

fun getValue(object: Parallax<Property<*, *>!>!): Float

Fast version of get() method that returns a primitive int value of the Property.

Parameters
object Parallax<Property<*, *>!>!: The Parallax object that owns this Property.
Return
Float: Float value of the Property.

set

fun set(object: Parallax<Property<*, *>!>!, value: Float!): Unit

setValue

fun setValue(object: Parallax<Property<*, *>!>!, value: Float): Unit

Fast version of set() method that takes a primitive float value into the Property.

Parameters
object Parallax<Property<*, *>!>!: The Parallax object that owns this Property.
value Parallax<Property<*, *>!>!: Float value of the Property.