# RecyclerViewParallax.ChildPositionProperty

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.ChildPositionProperty) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/leanback#1.1.0)

*** ** * ** ***


```
public final class RecyclerViewParallax.ChildPositionProperty extends Parallax.IntProperty
```

<br />

|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||||
| ↳ | [android.util.Property](https://developer.android.com/reference/android/util/Property.html) |||
|   | ↳ | [androidx.leanback.widget.Parallax.IntProperty](https://developer.android.com/reference/androidx/leanback/widget/Parallax.IntProperty) ||
|   |   | ↳ | [androidx.leanback.widget.RecyclerViewParallax.ChildPositionProperty](https://developer.android.com/reference/androidx/leanback/widget/RecyclerViewParallax.ChildPositionProperty) |

*** ** * ** ***

Subclass of `https://developer.android.com/reference/androidx/leanback/widget/Parallax.IntProperty`. Using this Property, users can track a RecylerView child's position inside recyclerview. i.e. tracking_pos = view.top + fraction \* view.height() + offset This way we can track top using fraction 0 and bottom using fraction 1.

## Summary

| ### Public methods |
|---|---|
| `https://developer.android.com/reference/androidx/leanback/widget/RecyclerViewParallax.ChildPositionProperty` | `https://developer.android.com/reference/androidx/leanback/widget/RecyclerViewParallax.ChildPositionProperty#adapterPosition(int)(int adapterPosition)` Sets adapter position of the recyclerview child to track. |
| `https://developer.android.com/reference/androidx/leanback/widget/RecyclerViewParallax.ChildPositionProperty` | `https://developer.android.com/reference/androidx/leanback/widget/RecyclerViewParallax.ChildPositionProperty#fraction(float)(float fraction)` Sets fraction of size to be added to view's start position. e.g. to track the center position of the view, use fraction 0.5; to track the end position of the view use fraction 1. |
| `int` | `https://developer.android.com/reference/androidx/leanback/widget/RecyclerViewParallax.ChildPositionProperty#getAdapterPosition()()` Returns adapter position of the recyclerview child to track. |
| `float` | `https://developer.android.com/reference/androidx/leanback/widget/RecyclerViewParallax.ChildPositionProperty#getFraction()()` Returns fraction of size to be added to view's start position. e.g. to track the center position of the view, use fraction 0.5; to track the end position of the view use fraction 1. |
| `int` | `https://developer.android.com/reference/androidx/leanback/widget/RecyclerViewParallax.ChildPositionProperty#getOffset()()` Returns offset in pixels added to the view's start position. |
| `int` | `https://developer.android.com/reference/androidx/leanback/widget/RecyclerViewParallax.ChildPositionProperty#getViewId()()` Returns view Id of a descendant of recyclerview child to track. |
| `https://developer.android.com/reference/androidx/leanback/widget/RecyclerViewParallax.ChildPositionProperty` | `https://developer.android.com/reference/androidx/leanback/widget/RecyclerViewParallax.ChildPositionProperty#offset(int)(int offset)` Sets offset in pixels added to the view's start position. |
| `https://developer.android.com/reference/androidx/leanback/widget/RecyclerViewParallax.ChildPositionProperty` | `https://developer.android.com/reference/androidx/leanback/widget/RecyclerViewParallax.ChildPositionProperty#viewId(int)(int viewId)` Sets view Id of a descendant of recyclerview child to track. |

| ### Inherited Constants |
|---|
| From [androidx.leanback.widget.Parallax.IntProperty](https://developer.android.com/reference/androidx/leanback/widget/Parallax.IntProperty) |---|---| | `static final int` | `https://developer.android.com/reference/androidx/leanback/widget/Parallax.IntProperty#UNKNOWN_AFTER() = 2147483647` Property value is unknown and it's larger than `https://developer.android.com/reference/androidx/leanback/widget/Parallax#getMaxValue()`. | | `static final int` | `https://developer.android.com/reference/androidx/leanback/widget/Parallax.IntProperty#UNKNOWN_BEFORE() = -2147483648` Property value is unknown and it's smaller than minimal value of Parallax. | |

| ### Inherited methods |
|---|
| From [androidx.leanback.widget.Parallax.IntProperty](https://developer.android.com/reference/androidx/leanback/widget/Parallax.IntProperty) |---|---| | `final https://developer.android.com/reference/androidx/leanback/widget/Parallax.PropertyMarkerValue` | `https://developer.android.com/reference/androidx/leanback/widget/Parallax.IntProperty#at(int,float)(int offsetValue, float fractionOfMaxParentVisibleSize)` Create an `https://developer.android.com/reference/androidx/leanback/widget/Parallax.PropertyMarkerValue` object by multiplying the fraction with `https://developer.android.com/reference/androidx/leanback/widget/Parallax#getMaxValue()` and adding offsetValue to it. | | `final https://developer.android.com/reference/androidx/leanback/widget/Parallax.PropertyMarkerValue` | `https://developer.android.com/reference/androidx/leanback/widget/Parallax.IntProperty#atAbsolute(int)(int absoluteValue)` Creates an `https://developer.android.com/reference/androidx/leanback/widget/Parallax.PropertyMarkerValue` object for the absolute marker value. | | `final https://developer.android.com/reference/androidx/leanback/widget/Parallax.PropertyMarkerValue` | `https://developer.android.com/reference/androidx/leanback/widget/Parallax.IntProperty#atFraction(float)(float fractionOfMaxValue)` Creates an `https://developer.android.com/reference/androidx/leanback/widget/Parallax.PropertyMarkerValue` object for a fraction of `https://developer.android.com/reference/androidx/leanback/widget/Parallax#getMaxValue()`. | | `final https://developer.android.com/reference/androidx/leanback/widget/Parallax.PropertyMarkerValue` | `https://developer.android.com/reference/androidx/leanback/widget/Parallax.IntProperty#atMax()()` Creates an `https://developer.android.com/reference/androidx/leanback/widget/Parallax.PropertyMarkerValue` object for the marker value representing `https://developer.android.com/reference/androidx/leanback/widget/Parallax#getMaxValue()`. | | `final https://developer.android.com/reference/androidx/leanback/widget/Parallax.PropertyMarkerValue` | `https://developer.android.com/reference/androidx/leanback/widget/Parallax.IntProperty#atMin()()` Creates an `https://developer.android.com/reference/androidx/leanback/widget/Parallax.PropertyMarkerValue` object for the marker value representing 0. | | `final https://developer.android.com/reference/java/lang/Integer.html` | `https://developer.android.com/reference/androidx/leanback/widget/Parallax.IntProperty#get(androidx.leanback.widget.Parallax)(https://developer.android.com/reference/androidx/leanback/widget/Parallax object)` | | `final int` | `https://developer.android.com/reference/androidx/leanback/widget/Parallax.IntProperty#getIndex()()` | | `final int` | `https://developer.android.com/reference/androidx/leanback/widget/Parallax.IntProperty#getValue(androidx.leanback.widget.Parallax)(https://developer.android.com/reference/androidx/leanback/widget/Parallax object)` Fast version of get() method that returns a primitive int value of the Property. | | `final void` | `https://developer.android.com/reference/androidx/leanback/widget/Parallax.IntProperty#set(androidx.leanback.widget.Parallax,java.lang.Integer)(https://developer.android.com/reference/androidx/leanback/widget/Parallax object, https://developer.android.com/reference/java/lang/Integer.html value)` | | `final void` | `https://developer.android.com/reference/androidx/leanback/widget/Parallax.IntProperty#setValue(androidx.leanback.widget.Parallax,int)(https://developer.android.com/reference/androidx/leanback/widget/Parallax object, int value)` Fast version of set() method that takes a primitive int value into the Property. | |
| From [android.util.Property](https://developer.android.com/reference/android/util/Property.html) |---|---| | `abstract V` | `https://developer.android.com/reference/android/util/Property.html#get(T)(T p)` | | `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/android/util/Property.html#getName()()` | | `https://developer.android.com/reference/java/lang/Class.html<V>` | `https://developer.android.com/reference/android/util/Property.html#getType()()` | | `boolean` | `https://developer.android.com/reference/android/util/Property.html#isReadOnly()()` | | `static https://developer.android.com/reference/android/util/Property.html<T, V>` | `<T, V> https://developer.android.com/reference/android/util/Property.html#of(java.lang.Class&lt;T&gt;, java.lang.Class&lt;V&gt;, java.lang.String)(https://developer.android.com/reference/java/lang/Class.html<T> hostType, https://developer.android.com/reference/java/lang/Class.html<V> valueType, https://developer.android.com/reference/java/lang/String.html name)` | | `void` | `https://developer.android.com/reference/android/util/Property.html#set(T, V)(T object, V value)` | |

## Public methods

### adapterPosition

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

```
public RecyclerViewParallax.ChildPositionProperty adapterPosition(int adapterPosition)
```

Sets adapter position of the recyclerview child to track.

| Parameters |
|---|---|
| `int adapterPosition` | Zero based position in adapter. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/leanback/widget/RecyclerViewParallax.ChildPositionProperty` | This ChildPositionProperty object. |

### fraction

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

```
public RecyclerViewParallax.ChildPositionProperty fraction(float fraction)
```

Sets fraction of size to be added to view's start position. e.g. to track the center position of the view, use fraction 0.5; to track the end position of the view use fraction 1.

| Parameters |
|---|---|
| `float fraction` | Fraction of size of the view. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/leanback/widget/RecyclerViewParallax.ChildPositionProperty` | This ChildPositionProperty object. |

### getAdapterPosition

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

```
public int getAdapterPosition()
```

Returns adapter position of the recyclerview child to track.

### getFraction

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

```
public float getFraction()
```

Returns fraction of size to be added to view's start position. e.g. to track the center position of the view, use fraction 0.5; to track the end position of the view use fraction 1.

### getOffset

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

```
public int getOffset()
```

Returns offset in pixels added to the view's start position.

### getViewId

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

```
public int getViewId()
```

Returns view Id of a descendant of recyclerview child to track.

### offset

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

```
public RecyclerViewParallax.ChildPositionProperty offset(int offset)
```

Sets offset in pixels added to the view's start position.

| Parameters |
|---|---|
| `int offset` | Offset in pixels added to the view's start position. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/leanback/widget/RecyclerViewParallax.ChildPositionProperty` | This ChildPositionProperty object. |

### viewId

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

```
public RecyclerViewParallax.ChildPositionProperty viewId(int viewId)
```

Sets view Id of a descendant of recyclerview child to track.

| Parameters |
|---|---|
| `int viewId` | Id of a descendant of recyclerview child. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/leanback/widget/RecyclerViewParallax.ChildPositionProperty` | This ChildPositionProperty object. |