ParallaxTarget.DirectPropertyTarget

class ParallaxTarget.DirectPropertyTarget<T : Any?, V : Number?> : ParallaxTarget


DirectPropertyTarget is to support direct mapping into either Integer Property or Float Property. App uses convenient method target to add a direct mapping.

Parameters
<T : Any?>

Type of target object.

<V : Number?>

Type of value, either Integer or Float.

Summary

Public constructors

DirectPropertyTarget(targetObject: Any!, property: Property<T!, V!>!)

Public functions

Unit

Directly update the target using a float or int value.

Boolean

Returns true as DirectPropertyTarget receives a number to update Property in directUpdate.

Inherited functions

From androidx.leanback.widget.ParallaxTarget
Unit
update(fraction: Float)

Implementation class is supposed to update target with the provided fraction (between 0 and 1).

Public constructors

DirectPropertyTarget

Added in 1.1.0
DirectPropertyTarget(targetObject: Any!, property: Property<T!, V!>!)
Parameters
targetObject: Any!

Target object for perform Parallax

property: Property<T!, V!>!

Target property, either an Integer Property or a Float Property.

Public functions

directUpdate

fun directUpdate(value: Number!): Unit

Directly update the target using a float or int value. Called when isDirectMapping is true.

Parameters
value: Number!

Either int or float value.

See also
isDirectMapping

isDirectMapping

fun isDirectMapping(): Boolean

Returns true as DirectPropertyTarget receives a number to update Property in directUpdate.