RecyclerViewParallax


public class RecyclerViewParallax extends Parallax

Known direct subclasses
DetailsParallax

Subclass of Parallax object that tracks overview row's top and bottom edge in DetailsFragment or DetailsSupportFragment.


Implementation of Parallax class for RecyclerView. This class allows users to track position of specific views inside RecyclerView relative to itself. See ChildPositionProperty for details.

Summary

Nested types

Subclass of Parallax.IntProperty.

Public constructors

Public methods

RecyclerViewParallax.ChildPositionProperty
createProperty(String name, int index)

Create a new Property object.

float

Return the max value which is typically size of parent visible area, e.g. RecyclerView's height if we are tracking Y position of a child.

RecyclerView
void

Set RecyclerView that this Parallax will register onScrollListener.

void

Manually update values.

Inherited methods

From androidx.leanback.widget.Parallax
ParallaxEffect
addEffect(Parallax.PropertyMarkerValue[] ranges)

Create a ParallaxEffect object that will track source variable changes within a provided set of ranges.

final PropertyT

Add a new IntProperty in the Parallax object.

List<ParallaxEffect>

Returns a list of ParallaxEffect object which defines rules to perform mapping to multiple ParallaxTargets.

final List<PropertyT>
void

Remove all ParallaxEffect objects.

void

Remove the ParallaxEffect object.

Public constructors

RecyclerViewParallax

Added in 1.1.0
public RecyclerViewParallax()

Public methods

createProperty

Added in 1.2.0-alpha04
public RecyclerViewParallax.ChildPositionProperty createProperty(String name, int index)

Create a new Property object. App does not directly call this method. See addProperty.

Parameters
int index

Index of the property in this Parallax object.

Returns
RecyclerViewParallax.ChildPositionProperty

Newly created Property object.

getMaxValue

Added in 1.2.0-alpha04
public float getMaxValue()

Return the max value which is typically size of parent visible area, e.g. RecyclerView's height if we are tracking Y position of a child. The size can be used to calculate marker value using the provided fraction of FloatPropertyMarkerValue.

Returns
float

Size of parent visible area.

getRecyclerView

Added in 1.1.0
public RecyclerView getRecyclerView()
Returns
RecyclerView

Currently RecylerView that the source has registered onScrollListener.

setRecyclerView

Added in 1.1.0
public void setRecyclerView(RecyclerView recyclerView)

Set RecyclerView that this Parallax will register onScrollListener.

Parameters
RecyclerView recyclerView

RecyclerView to register onScrollListener.

updateValues

public void updateValues()

Manually update values. This is used for changes not controlled by RecyclerView. E.g. called by a Slide transition that changes translation of the view.