RecyclerViewParallax

class RecyclerViewParallax : 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

Public constructors

Public functions

RecyclerViewParallax.ChildPositionProperty!
createProperty(name: String!, index: Int)

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!
Unit
setRecyclerView(recyclerView: RecyclerView!)

Set RecyclerView that this Parallax will register onScrollListener.

Unit

Manually update values.

Inherited functions

From androidx.leanback.widget.Parallax
ParallaxEffect!

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

PropertyT!

Add a new IntProperty in the Parallax object.

(Mutable)List<ParallaxEffect!>!

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

(Mutable)List<PropertyT!>!
Unit

Remove all ParallaxEffect objects.

Unit

Remove the ParallaxEffect object.

Public constructors

RecyclerViewParallax

Added in 1.1.0
RecyclerViewParallax()

Public functions

createProperty

Added in 1.2.0-alpha04
fun createProperty(name: String!, index: Int): RecyclerViewParallax.ChildPositionProperty!

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

Parameters
index: Int

Index of the property in this Parallax object.

Returns
RecyclerViewParallax.ChildPositionProperty!

Newly created Property object.

getMaxValue

Added in 1.2.0-alpha04
fun getMaxValue(): 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. 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
fun getRecyclerView(): RecyclerView!
Returns
RecyclerView!

Currently RecylerView that the source has registered onScrollListener.

setRecyclerView

Added in 1.1.0
fun setRecyclerView(recyclerView: RecyclerView!): Unit

Set RecyclerView that this Parallax will register onScrollListener.

Parameters
recyclerView: RecyclerView!

RecyclerView to register onScrollListener.

updateValues

fun updateValues(): Unit

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.