RecyclerViewParallax.ChildPositionProperty

class RecyclerViewParallax.ChildPositionProperty : 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 functions

RecyclerViewParallax.ChildPositionProperty!
adapterPosition(adapterPosition: Int)

Sets adapter position of the recyclerview child to track.

RecyclerViewParallax.ChildPositionProperty!
fraction(fraction: Float)

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(offset: Int)

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

RecyclerViewParallax.ChildPositionProperty!
viewId(viewId: Int)

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

Inherited Constants

From androidx.leanback.widget.Parallax.IntProperty
const Int
UNKNOWN_AFTER = 2147483647

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

const Int
UNKNOWN_BEFORE = -2147483648

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

Inherited functions

From androidx.leanback.widget.Parallax.IntProperty
Parallax.PropertyMarkerValue!
at(offsetValue: Int, fractionOfMaxParentVisibleSize: Float)

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

Parallax.PropertyMarkerValue!
atAbsolute(absoluteValue: Int)

Creates an PropertyMarkerValue object for the absolute marker value.

Parallax.PropertyMarkerValue!
atFraction(fractionOfMaxValue: Float)

Creates an PropertyMarkerValue object for a fraction of getMaxValue.

Parallax.PropertyMarkerValue!

Creates an PropertyMarkerValue object for the marker value representing getMaxValue.

Parallax.PropertyMarkerValue!

Creates an PropertyMarkerValue object for the marker value representing 0.

Int!
get(object: Parallax!)
Int
Int
getValue(object: Parallax!)

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

Unit
set(object: Parallax!, value: Int!)
Unit
setValue(object: Parallax!, value: Int)

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

From android.util.Property
abstract V!
get(p: T!)
String!
Class<V!>!
Boolean
java-static Property<T!, V!>!
<T, V> of(hostType: Class<T!>!, valueType: Class<V!>!, name: String!)
Unit
set(object: T!, value: V!)

Public functions

adapterPosition

Added in 1.1.0
fun adapterPosition(adapterPosition: Int): RecyclerViewParallax.ChildPositionProperty!

Sets adapter position of the recyclerview child to track.

Parameters
adapterPosition: Int

Zero based position in adapter.

Returns
RecyclerViewParallax.ChildPositionProperty!

This ChildPositionProperty object.

fraction

Added in 1.1.0
fun fraction(fraction: Float): RecyclerViewParallax.ChildPositionProperty!

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: Float

Fraction of size of the view.

Returns
RecyclerViewParallax.ChildPositionProperty!

This ChildPositionProperty object.

getAdapterPosition

Added in 1.1.0
fun getAdapterPosition(): Int

Returns adapter position of the recyclerview child to track.

getFraction

Added in 1.1.0
fun getFraction(): 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.

getOffset

Added in 1.1.0
fun getOffset(): Int

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

getViewId

Added in 1.1.0
fun getViewId(): Int

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

offset

Added in 1.1.0
fun offset(offset: Int): RecyclerViewParallax.ChildPositionProperty!

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

Parameters
offset: Int

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

Returns
RecyclerViewParallax.ChildPositionProperty!

This ChildPositionProperty object.

viewId

Added in 1.1.0
fun viewId(viewId: Int): RecyclerViewParallax.ChildPositionProperty!

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

Parameters
viewId: Int

Id of a descendant of recyclerview child.

Returns
RecyclerViewParallax.ChildPositionProperty!

This ChildPositionProperty object.