public final class

RecyclerViewParallax.ChildPositionProperty

extends Parallax.IntProperty

 java.lang.Object

↳<any>

androidx.leanback.widget.Parallax.IntProperty

↳androidx.leanback.widget.RecyclerViewParallax.ChildPositionProperty

Overview

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

Fields
from Parallax.IntPropertyUNKNOWN_AFTER, UNKNOWN_BEFORE
Methods
public RecyclerViewParallax.ChildPositionPropertyadapterPosition(int adapterPosition)

Sets adapter position of the recyclerview child to track.

public RecyclerViewParallax.ChildPositionPropertyfraction(float fraction)

Sets fraction of size to be added to view's start position.

public intgetAdapterPosition()

Returns adapter position of the recyclerview child to track.

public floatgetFraction()

Returns fraction of size to be added to view's start position.

public intgetOffset()

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

public intgetViewId()

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

public RecyclerViewParallax.ChildPositionPropertyoffset(int offset)

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

public RecyclerViewParallax.ChildPositionPropertyviewId(int viewId)

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

from Parallax.IntPropertyat, atAbsolute, atFraction, atMax, atMin, get, getIndex, getValue, set, setValue
from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Methods

public RecyclerViewParallax.ChildPositionProperty adapterPosition(int adapterPosition)

Sets adapter position of the recyclerview child to track.

Parameters:

adapterPosition: Zero based position in adapter.

Returns:

This ChildPositionProperty object.

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

Parameters:

viewId: Id of a descendant of recyclerview child.

Returns:

This ChildPositionProperty object.

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

Parameters:

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

Returns:

This ChildPositionProperty object.

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:

fraction: Fraction of size of the view.

Returns:

This ChildPositionProperty object.

public int getAdapterPosition()

Returns adapter position of the recyclerview child to track.

public int getViewId()

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

public int getOffset()

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

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.