Parallax.FloatProperty


public class Parallax.FloatProperty extends Property


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

Summary

Constants

static final float
UNKNOWN_AFTER = 3.4028235E38f

Property value is unknown and it's larger than getMaxValue.

static final float
UNKNOWN_BEFORE = -3.4028235E38f

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

Public constructors

FloatProperty(String name, int index)

Constructor.

Public methods

final Parallax.PropertyMarkerValue
at(float offsetValue, float fractionOfMaxParentVisibleSize)

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

final Parallax.PropertyMarkerValue
atAbsolute(float markerValue)

Creates an PropertyMarkerValue object for the absolute marker value.

final Parallax.PropertyMarkerValue
atFraction(float fractionOfMaxParentVisibleSize)

Creates an PropertyMarkerValue object for a fraction of getMaxValue.

final Parallax.PropertyMarkerValue

Creates an PropertyMarkerValue object for the marker value representing getMaxValue.

final Parallax.PropertyMarkerValue

Creates an PropertyMarkerValue object for the marker value representing 0.

final Float
get(Parallax object)
final int
final float

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

final void
set(Parallax object, Float value)
final void
setValue(Parallax object, float value)

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

Inherited methods

From android.util.Property
String
Class<V>
boolean
static Property<T, V>
<T, V> of(Class<T> hostType, Class<V> valueType, String name)

Constants

UNKNOWN_AFTER

Added in 1.1.0
public static final float UNKNOWN_AFTER = 3.4028235E38f

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

UNKNOWN_BEFORE

Added in 1.1.0
public static final float UNKNOWN_BEFORE = -3.4028235E38f

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.

Public constructors

FloatProperty

Added in 1.1.0
public FloatProperty(String name, int index)

Constructor.

Parameters
String name

Name of this Property.

int index

Index of this Property inside Parallax.

Public methods

at

Added in 1.1.0
public final Parallax.PropertyMarkerValue at(float offsetValue, float fractionOfMaxParentVisibleSize)

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

Parameters
float offsetValue

An offset float value to be added to marker value.

float fractionOfMaxParentVisibleSize

0 to 1 fraction to multiply with getMaxValue for the marker value.

atAbsolute

Added in 1.1.0
public final Parallax.PropertyMarkerValue atAbsolute(float markerValue)

Creates an PropertyMarkerValue object for the absolute marker value.

Parameters
float markerValue

The float marker value.

atFraction

Added in 1.1.0
public final Parallax.PropertyMarkerValue atFraction(float fractionOfMaxParentVisibleSize)

Creates an PropertyMarkerValue object for a fraction of getMaxValue.

Parameters
float fractionOfMaxParentVisibleSize

0 to 1 fraction to multiply with getMaxValue for the marker value.

atMax

Added in 1.1.0
public final Parallax.PropertyMarkerValue atMax()

Creates an PropertyMarkerValue object for the marker value representing getMaxValue.

atMin

Added in 1.1.0
public final Parallax.PropertyMarkerValue atMin()

Creates an PropertyMarkerValue object for the marker value representing 0.

get

Added in 1.1.0
public final Float get(Parallax object)

getIndex

Added in 1.1.0
public final int getIndex()
Returns
int

Index of this Property in Parallax.

getValue

Added in 1.1.0
public final float getValue(Parallax object)

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

Parameters
Parallax object

The Parallax object that owns this Property.

Returns
float

Float value of the Property.

set

Added in 1.1.0
public final void set(Parallax object, Float value)

setValue

Added in 1.1.0
public final void setValue(Parallax object, float value)

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

Parameters
Parallax object

The Parallax object that owns this Property.

float value

Float value of the Property.