ChildPositionProperty
class 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
Inherited constants |
|
---|---|
Public methods |
|
---|---|
RecyclerViewParallax.ChildPositionProperty! |
adapterPosition(adapterPosition: Int) Sets adapter position of the recyclerview child to track. |
RecyclerViewParallax.ChildPositionProperty! |
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! |
Sets offset in pixels added to the view's start position. |
RecyclerViewParallax.ChildPositionProperty! |
Sets view Id of a descendant of recyclerview child to track. |
Inherited functions |
|
---|---|
Public methods
adapterPosition
fun adapterPosition(adapterPosition: Int): RecyclerViewParallax.ChildPositionProperty!
Sets adapter position of the recyclerview child to track.
Parameters | |
---|---|
adapterPosition |
Int: Zero based position in adapter. |
Return | |
---|---|
RecyclerViewParallax.ChildPositionProperty!: This ChildPositionProperty object. |
fraction
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. |
Return | |
---|---|
RecyclerViewParallax.ChildPositionProperty!: This ChildPositionProperty object. |
getAdapterPosition
fun getAdapterPosition(): Int
Returns adapter position of the recyclerview child to track.
getFraction
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.
offset
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. |
Return | |
---|---|
RecyclerViewParallax.ChildPositionProperty!: This ChildPositionProperty object. |
viewId
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. |
Return | |
---|---|
RecyclerViewParallax.ChildPositionProperty!: This ChildPositionProperty object. |