ParallaxTarget.DirectPropertyTarget


public final class ParallaxTarget.DirectPropertyTarget<T extends Object, V extends Number> extends 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 extends Object>

Type of target object.

<V extends Number>

Type of value, either Integer or Float.

Summary

Public constructors

DirectPropertyTarget(Object targetObject, Property<T, V> property)

Public methods

void

Directly update the target using a float or int value.

boolean

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

Inherited methods

From androidx.leanback.widget.ParallaxTarget
void
update(float fraction)

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

Public constructors

DirectPropertyTarget

Added in 1.1.0
public DirectPropertyTarget(Object targetObject, Property<T, V> property)
Parameters
Object targetObject

Target object for perform Parallax

Property<T, V> property

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

Public methods

directUpdate

public void directUpdate(Number value)

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

Parameters
Number value

Either int or float value.

See also
isDirectMapping

isDirectMapping

public boolean isDirectMapping()

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