RecyclerViewParallax.ChildPositionProperty

public final class RecyclerViewParallax.ChildPositionProperty extends Parallax.IntProperty


Subclass of 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

RecyclerViewParallax.ChildPositionProperty
adapterPosition(int adapterPosition)

Sets adapter position of the recyclerview child to track.

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.

int

Returns adapter position of the recyclerview child to track.

float

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

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

int

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

RecyclerViewParallax.ChildPositionProperty
offset(int offset)

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

RecyclerViewParallax.ChildPositionProperty
viewId(int viewId)

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

Inherited Constants

From androidx.leanback.widget.Parallax.IntProperty
static final int
UNKNOWN_AFTER = 2147483647

Property value is unknown and it's larger than getMaxValue.

static final int
UNKNOWN_BEFORE = -2147483648

Property value is unknown and it's smaller than minimal value of Parallax.

Inherited methods

From androidx.leanback.widget.Parallax.IntProperty
final Parallax.PropertyMarkerValue
at(int offsetValue, float fractionOfMaxParentVisibleSize)

Create an PropertyMarkerValue object by multiplying the fraction with getMaxValue and adding offsetValue to it.

final Parallax.PropertyMarkerValue
atAbsolute(int absoluteValue)

Creates an PropertyMarkerValue object for the absolute marker value.

final Parallax.PropertyMarkerValue
atFraction(float fractionOfMaxValue)

Creates an PropertyMarkerValue object for a fraction of getMaxValue.

final Parallax.PropertyMarkerValue

Creates an PropertyMarkerValue object for the marker value representing getMaxValue.

final Parallax.PropertyMarkerValue

Creates an PropertyMarkerValue object for the marker value representing 0.

final Integer
get(Parallax object)
final int
final int

Fast version of get() method that returns a primitive int value of the Property.

final void
set(Parallax object, Integer value)
final void
setValue(Parallax object, int value)

Fast version of set() method that takes a primitive int value into the Property.

From android.util.Property
abstract V
get(T p)
String
Class<V>
boolean
static Property<T, V>
<T, V> of(Class<T> hostType, Class<V> valueType, String name)
void
set(T object, V value)

Public methods

adapterPosition

Added in 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
RecyclerViewParallax.ChildPositionProperty

This ChildPositionProperty object.

fraction

Added in 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
RecyclerViewParallax.ChildPositionProperty

This ChildPositionProperty object.

getAdapterPosition

Added in 1.1.0
public int getAdapterPosition()

Returns adapter position of the recyclerview child to track.

getFraction

Added in 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
public int getOffset()

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

getViewId

Added in 1.1.0
public int getViewId()

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

offset

Added in 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
RecyclerViewParallax.ChildPositionProperty

This ChildPositionProperty object.

viewId

Added in 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
RecyclerViewParallax.ChildPositionProperty

This ChildPositionProperty object.