# RecyclerViewParallax

Artifact: [androidx.leanback:leanback](https://developer.android.com/jetpack/androidx/releases/leanback) [View Source](https://cs.android.com/search?q=file:androidx/leanback/widget/RecyclerViewParallax.java+class:androidx.leanback.widget.RecyclerViewParallax) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

*** ** * ** ***


```
class RecyclerViewParallax : Parallax<RecyclerViewParallax.ChildPositionProperty!>
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.leanback.widget.Parallax](https://developer.android.com/reference/kotlin/androidx/leanback/widget/Parallax)\<[RecyclerViewParallax.ChildPositionProperty](https://developer.android.com/reference/kotlin/androidx/leanback/widget/RecyclerViewParallax.ChildPositionProperty)!\> ||
|   | ↳ | [androidx.leanback.widget.RecyclerViewParallax](https://developer.android.com/reference/kotlin/androidx/leanback/widget/RecyclerViewParallax) |

Known direct subclasses [DetailsParallax](https://developer.android.com/reference/kotlin/androidx/leanback/widget/DetailsParallax)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/leanback/widget/DetailsParallax` | Subclass of Parallax object that tracks overview row's top and bottom edge in DetailsFragment or DetailsSupportFragment. |

*** ** * ** ***

Implementation of `https://developer.android.com/reference/kotlin/androidx/leanback/widget/Parallax` class for `https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView`. This class allows users to track position of specific views inside `https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView` relative to itself. See `https://developer.android.com/reference/kotlin/androidx/leanback/widget/RecyclerViewParallax.ChildPositionProperty` for details.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/leanback/widget/RecyclerViewParallax.ChildPositionProperty : https://developer.android.com/reference/kotlin/androidx/leanback/widget/Parallax.IntProperty` Subclass of `https://developer.android.com/reference/kotlin/androidx/leanback/widget/Parallax.IntProperty`. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/leanback/widget/RecyclerViewParallax#RecyclerViewParallax()()` |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/leanback/widget/RecyclerViewParallax.ChildPositionProperty!` | `https://developer.android.com/reference/kotlin/androidx/leanback/widget/RecyclerViewParallax#createProperty(java.lang.String,int)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Create a new Property object. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/leanback/widget/RecyclerViewParallax#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. |
| `https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView!` | `https://developer.android.com/reference/kotlin/androidx/leanback/widget/RecyclerViewParallax#getRecyclerView()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/leanback/widget/RecyclerViewParallax#setRecyclerView(androidx.recyclerview.widget.RecyclerView)(recyclerView: https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView!)` Set RecyclerView that this Parallax will register onScrollListener. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/leanback/widget/RecyclerViewParallax#updateValues()()` Manually update values. |

### Inherited functions

From [androidx.leanback.widget.Parallax](https://developer.android.com/reference/kotlin/androidx/leanback/widget/Parallax) `https://developer.android.com/reference/kotlin/androidx/leanback/widget/ParallaxEffect!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/Parallax#addEffect(androidx.leanback.widget.Parallax.PropertyMarkerValue...)(ranges: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/leanback/widget/Parallax.PropertyMarkerValue!>!)`

Create a `https://developer.android.com/reference/kotlin/androidx/leanback/widget/ParallaxEffect` object that will track source variable changes within a provided set of ranges.
`PropertyT!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/Parallax#addProperty(java.lang.String)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)`

Add a new IntProperty in the Parallax object.
`(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/leanback/widget/ParallaxEffect!>!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/Parallax#getEffects()()`

Returns a list of `https://developer.android.com/reference/kotlin/androidx/leanback/widget/ParallaxEffect` object which defines rules to perform mapping to multiple `https://developer.android.com/reference/kotlin/androidx/leanback/widget/ParallaxTarget`s.
`(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<PropertyT!>!` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/Parallax#getProperties()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/Parallax#removeAllEffects()()`

Remove all `https://developer.android.com/reference/kotlin/androidx/leanback/widget/ParallaxEffect` objects.
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/leanback/widget/Parallax#removeEffect(androidx.leanback.widget.ParallaxEffect)(effect: https://developer.android.com/reference/kotlin/androidx/leanback/widget/ParallaxEffect!)`

Remove the `https://developer.android.com/reference/kotlin/androidx/leanback/widget/ParallaxEffect` object.

## Public constructors

### RecyclerViewParallax

Added in 1.1.0

```
RecyclerViewParallax()
```

## Public functions

### createProperty

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

Create a new Property object. App does not directly call this method. See `https://developer.android.com/reference/kotlin/androidx/leanback/widget/Parallax#addProperty(java.lang.String)`.

| Parameters |
|---|---|
| `name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | Name of the property in this Parallax object |
| `index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Index of the property in this Parallax object. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/leanback/widget/RecyclerViewParallax.ChildPositionProperty!` | Newly created Property object. |

### getMaxValue

```
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 |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | Size of parent visible area. |

### getRecyclerView

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
fun getRecyclerView(): RecyclerView!
```

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/RecyclerView!` | Currently RecylerView that the source has registered onScrollListener. |

### setRecyclerView

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

```
fun setRecyclerView(recyclerView: RecyclerView!): Unit
```

Set RecyclerView that this Parallax will register onScrollListener.

| Parameters |
|---|---|
| `recyclerView: https://developer.android.com/reference/kotlin/androidx/recyclerview/widget/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.