RecyclerViewParallax
public class RecyclerViewParallax extends Parallax
| java.lang.Object | ||
| ↳ | androidx.leanback.widget.Parallax | |
| ↳ | androidx.leanback.widget.RecyclerViewParallax |
DetailsParallax |
Subclass of Parallax object that tracks overview row's top and bottom edge in DetailsFragment or DetailsSupportFragment. |
Implementation of Parallax class for RecyclerView. This class allows users to track position of specific views inside RecyclerView relative to itself. See ChildPositionProperty for details.
Summary
Nested types |
|---|
public final class RecyclerViewParallax.ChildPositionProperty extends Parallax.IntPropertySubclass of |
Public constructors |
|---|
Public methods |
|
|---|---|
RecyclerViewParallax.ChildPositionProperty |
createProperty(String name, int index)Create a new Property object. |
float |
Return the max value which is typically size of parent visible area, e.g. RecyclerView's height if we are tracking Y position of a child. |
RecyclerView |
|
void |
setRecyclerView(RecyclerView recyclerView)Set RecyclerView that this Parallax will register onScrollListener. |
void |
Manually update values. |
Inherited methods |
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Public constructors
Public methods
createProperty
public RecyclerViewParallax.ChildPositionProperty createProperty(String name, int index)
Create a new Property object. App does not directly call this method. See addProperty.
| Parameters | |
|---|---|
String name |
Name of the property in this Parallax object |
int index |
Index of the property in this Parallax object. |
| Returns | |
|---|---|
RecyclerViewParallax.ChildPositionProperty |
Newly created Property object. |
getMaxValue
public float getMaxValue()
Return the max value which is typically size of parent visible area, e.g. RecyclerView's height if we are tracking Y position of a child. The size can be used to calculate marker value using the provided fraction of FloatPropertyMarkerValue.
| Returns | |
|---|---|
float |
Size of parent visible area. |
getRecyclerView
public RecyclerView getRecyclerView()
| Returns | |
|---|---|
RecyclerView |
Currently RecylerView that the source has registered onScrollListener. |
setRecyclerView
public void setRecyclerView(RecyclerView recyclerView)
Set RecyclerView that this Parallax will register onScrollListener.
| Parameters | |
|---|---|
RecyclerView recyclerView |
RecyclerView to register onScrollListener. |
updateValues
public void updateValues()
Manually update values. This is used for changes not controlled by RecyclerView. E.g. called by a Slide transition that changes translation of the view.