public class RecyclerEventsController
extends java.lang.Object
Prop
to a Recycler
component to trigger events from outside the component hierarchy.Modifier and Type | Class and Description |
---|---|
static interface |
RecyclerEventsController.OnRecyclerUpdateListener |
Constructor and Description |
---|
RecyclerEventsController() |
Modifier and Type | Method and Description |
---|---|
void |
clearRefreshing() |
RecyclerView |
getRecyclerView() |
void |
requestScrollToPosition(int position,
boolean animated)
Send the Recycler a request to scroll the content to a specific item in the binder.
|
void |
requestScrollToPositionWithOffset(int position,
int offset)
Send the Recycler a request to scroll the content to a specific item in the binder with the
given offset from resolved layout start.
|
void |
requestScrollToTop(boolean animated)
Send the Recycler a request to scroll the content to the first item in the binder.
|
void |
setOnRecyclerUpdateListener(RecyclerEventsController.OnRecyclerUpdateListener onRecyclerUpdateListener) |
void |
setSectionsRecyclerView(SectionsRecyclerView sectionsRecyclerView) |
void |
showRefreshing() |
public void requestScrollToTop(boolean animated)
animated
- if animated is set to true the scroll will happen with an animation.public void requestScrollToPosition(int position, boolean animated)
animated
- if animated is set to true the scroll will happen with an animation.public void requestScrollToPositionWithOffset(int position, int offset)
If you are just trying to make a position visible, use requestScrollToPosition(int,
boolean)
.
Note: This offset is valid for LinearLayout only!
position
- Index (starting at 0) of the reference item.offset
- The distance (in pixels) between the start edge of the item view and start edge
of the RecyclerView.public void clearRefreshing()
public void showRefreshing()
public void setSectionsRecyclerView(SectionsRecyclerView sectionsRecyclerView)
public RecyclerView getRecyclerView()
public void setOnRecyclerUpdateListener(RecyclerEventsController.OnRecyclerUpdateListener onRecyclerUpdateListener)