belongs to Maven artifact androidx.leanback:leanback:1.0.0-alpha1

RecyclerViewParallax

public class RecyclerViewParallax
extends Parallax<RecyclerViewParallax.ChildPositionProperty>

java.lang.Object
   ↳ androidx.leanback.widget.Parallax<androidx.leanback.widget.RecyclerViewParallax.ChildPositionProperty>
     ↳ androidx.leanback.widget.RecyclerViewParallax


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

Summary

Nested classes

class RecyclerViewParallax.ChildPositionProperty

Subclass of Parallax.IntProperty

Public constructors

RecyclerViewParallax()

Public methods

RecyclerViewParallax.ChildPositionProperty createProperty(String name, int index)

Create a new Property object.

float getMaxValue()

Return the max value which is typically size of parent visible area, e.g.

RecyclerView getRecyclerView()
void setRecyclerView(RecyclerView recyclerView)

Set RecyclerView that this Parallax will register onScrollListener.

void updateValues()

Manually update values.

Inherited methods

Public constructors

RecyclerViewParallax

RecyclerViewParallax ()

Public methods

createProperty

RecyclerViewParallax.ChildPositionProperty createProperty (String name, 
                int index)

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

Parameters
name String

index int: Index of the property in this Parallax object.

Returns
RecyclerViewParallax.ChildPositionProperty Newly created Property object.

getMaxValue

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

RecyclerView getRecyclerView ()

Returns
RecyclerView Currently RecylerView that the source has registered onScrollListener.

setRecyclerView

void setRecyclerView (RecyclerView recyclerView)

Set RecyclerView that this Parallax will register onScrollListener.

Parameters
recyclerView RecyclerView: RecyclerView to register onScrollListener.

updateValues

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.