ParallaxTarget
This package is part of the
Android support library which
is no longer maintained.
The support library has been superseded by AndroidX
which is part of Jetpack .
We recommend using the AndroidX libraries in all new projects. You should also consider
migrating existing projects to AndroidX.
To find the AndroidX class that maps to this deprecated class, see the AndroidX
support library class
mappings .
public
abstract
class
ParallaxTarget
extends Object
java.lang.Object
↳
android.support.v17.leanback.widget.ParallaxTarget
Known Direct Subclasses
ParallaxTarget is responsible for updating the target through the update(float)
method
or the directUpdate(Number)
method when isDirectMapping()
is true.
When isDirectMapping()
is false, ParallaxEffect
transforms the values of
Parallax
, which represents the current state of UI, into a float value between 0 and 1.
That float value is passed into update(float)
method.
Summary
Nested classes
class
ParallaxTarget.DirectPropertyTarget <T, V extends Number>
DirectPropertyTarget is to support direct mapping into either Integer Property or Float
Property.
class
ParallaxTarget.PropertyValuesHolderTarget
PropertyValuesHolderTarget is an implementation of ParallaxTarget
that uses
PropertyValuesHolder
to update the target object.
Public methods
void
directUpdate (Number value)
Directly update the target using a float or int value.
boolean
isDirectMapping ()
Returns true if the ParallaxTarget is directly mapping from source value,
directUpdate(Number)
will be used to update value, otherwise update(fraction) will
be called to update value.
void
update (float fraction)
Implementation class is supposed to update target with the provided fraction
(between 0 and 1).
Inherited methods
From
class
java.lang.Object
Object
clone()
boolean
equals(Object arg0)
void
finalize()
final
Class<?>
getClass()
int
hashCode()
final
void
notify()
final
void
notifyAll()
String
toString()
final
void
wait(long arg0, int arg1)
final
void
wait(long arg0)
final
void
wait()
Public constructors
ParallaxTarget
ParallaxTarget ()
Public methods
directUpdate
void directUpdate (Number value)
Directly update the target using a float or int value. Called when isDirectMapping()
is true.
Parameters
value
Number
: Either int or float value.
isDirectMapping
boolean isDirectMapping ()
Returns true if the ParallaxTarget is directly mapping from source value,
directUpdate(Number)
will be used to update value, otherwise update(fraction) will
be called to update value. Default implementation returns false.
Returns
boolean
True if direct mapping, false otherwise.
update
void update (float fraction)
Implementation class is supposed to update target with the provided fraction
(between 0 and 1). The fraction represents percentage of completed change (e.g. scroll) on
target. Called only when isDirectMapping()
is false.
Parameters
fraction
float
: Fraction between 0 to 1.