ParallaxEffect
public
abstract
class
ParallaxEffect
extends Object
| java.lang.Object | |
| ↳ | androidx.leanback.widget.ParallaxEffect |
ParallaxEffect class drives changes in ParallaxTarget in response to changes in
variables defined in Parallax.
ParallaxEffect has a list of Parallax.PropertyMarkerValues which represents the range of
values that source variables can take. The main function is
performMapping(Parallax) which computes a fraction between 0 and 1
based on the current values of variables in Parallax. As the parallax effect goes
on, the fraction increases from 0 at beginning to 1 at the end. Then the fraction is passed on
to ParallaxTarget.update(float).
App use Parallax.addEffect(PropertyMarkerValue) to create a ParallaxEffect.
Summary
Public methods | |
|---|---|
final
void
|
addTarget(ParallaxTarget target)
Add a ParallaxTarget to run parallax effect. |
final
List<PropertyMarkerValue>
|
getPropertyRanges()
Returns the list of |
final
List<ParallaxTarget>
|
getTargets()
Returns the list of |
final
void
|
performMapping(Parallax source)
Perform mapping from |
final
void
|
removeTarget(ParallaxTarget target)
Remove a |
final
void
|
setPropertyRanges(PropertyMarkerValue... markerValues)
Sets the list of |
final
<T, V extends Number>
ParallaxEffect
|
target(T targetObject, Property<T, V> targetProperty)
Creates a |
final
ParallaxEffect
|
target(Object targetObject, PropertyValuesHolder values)
Creates a |
final
ParallaxEffect
|
target(ParallaxTarget target)
Add a ParallaxTarget to run parallax effect. |
Inherited methods | |
|---|---|
Public methods
addTarget
public final void addTarget (ParallaxTarget target)
Add a ParallaxTarget to run parallax effect.
| Parameters | |
|---|---|
target |
ParallaxTarget: ParallaxTarget to add.
|
getPropertyRanges
public final List<PropertyMarkerValue> getPropertyRanges ()
Returns the list of Parallax.PropertyMarkerValues, which represents the range of values that
source variables can take.
| Returns | |
|---|---|
List<PropertyMarkerValue> |
A list of Parallax.PropertyMarkerValues. |
See also:
getTargets
public final List<ParallaxTarget> getTargets ()
Returns the list of ParallaxTarget objects.
| Returns | |
|---|---|
List<ParallaxTarget> |
The list of ParallaxTarget objects.
|
performMapping
public final void performMapping (Parallax source)
Perform mapping from Parallax to list of ParallaxTarget.
| Parameters | |
|---|---|
source |
Parallax |
removeTarget
public final void removeTarget (ParallaxTarget target)
Remove a ParallaxTarget object from the list.
| Parameters | |
|---|---|
target |
ParallaxTarget: The ParallaxTarget object to be removed.
|
setPropertyRanges
public final void setPropertyRanges (PropertyMarkerValue... markerValues)
Sets the list of Parallax.PropertyMarkerValues, which represents the range of values that
source variables can take.
| Parameters | |
|---|---|
markerValues |
PropertyMarkerValue: A list of Parallax.PropertyMarkerValues. |
See also:
target
public final ParallaxEffect target (T targetObject, Property<T, V> targetProperty)
Creates a ParallaxTarget using direct mapping from source property into target
property, the new ParallaxTarget will be added to its list of targets.
| Parameters | |
|---|---|
targetObject |
T: Target object for property. |
targetProperty |
Property: The target property that will receive values. |
| Returns | |
|---|---|
ParallaxEffect |
This ParallaxEffect object, allowing calls to methods in this class to be chained. |
See also:
target
public final ParallaxEffect target (Object targetObject, PropertyValuesHolder values)
Creates a ParallaxTarget from PropertyValuesHolder and adds it to the list
of targets.
| Parameters | |
|---|---|
targetObject |
Object: Target object for PropertyValuesHolderTarget. |
values |
PropertyValuesHolder: PropertyValuesHolder for PropertyValuesHolderTarget. |
| Returns | |
|---|---|
ParallaxEffect |
This ParallaxEffect object, allowing calls to methods in this class to be chained. |
target
public final ParallaxEffect target (ParallaxTarget target)
Add a ParallaxTarget to run parallax effect.
| Parameters | |
|---|---|
target |
ParallaxTarget: ParallaxTarget to add. |
| Returns | |
|---|---|
ParallaxEffect |
This ParallaxEffect object, allowing calls to methods in this class to be chained. |