Android 12 Developer Preview is here! Try it out, and give us your feedback!

ChildPositionProperty

class ChildPositionProperty : Parallax.IntProperty
kotlin.Any
   ↳ android.util.Property<androidx.leanback.widget.Parallax<android.util.Property<*, *>>, kotlin.Int>
   ↳ androidx.leanback.widget.Parallax.IntProperty
   ↳ androidx.leanback.widget.RecyclerViewParallax.ChildPositionProperty

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

Inherited constants
Public methods
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.

Int

Returns adapter position of the recyclerview child to track.

Float

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

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 functions