java.lang.Object | |
↳ | android.support.v7.widget.RecyclerView.SmoothScroller |
Known Direct Subclasses |
Base class for smooth scrolling. Handles basic tracking of the target view position and provides methods to trigger a programmatic scroll.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
RecyclerView.SmoothScroller.Action | Holds information about a smooth scroll request by a RecyclerView.SmoothScroller . |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the adapter position of the target item
| |||||||||||
Returns true if SmoothScroller has beens started but has not received the first
animation
callback yet.
| |||||||||||
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Normalizes the vector.
| |||||||||||
RecyclerView will call this method each time it scrolls until it can find the target position in the layout. | |||||||||||
Called when smooth scroll is started.
| |||||||||||
Called when smooth scroller is stopped.
| |||||||||||
Called when the target position is laid out.
| |||||||||||
Stops running the SmoothScroller in each animation callback.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Returns the adapter position of the target item
NO_POSITION
if no target view is set.
Returns true if SmoothScroller has beens started but has not received the first animation callback yet.
Normalizes the vector.
scrollVector | The vector that points to the target scroll position |
---|
RecyclerView will call this method each time it scrolls until it can find the target position in the layout.
SmoothScroller should check dx, dy and if scroll should be changed, update the
provided RecyclerView.SmoothScroller.Action
to define the next scroll.
dx | Last scroll amount horizontally |
---|---|
dy | Last scroll amount verticaully |
state | Transient state of RecyclerView |
action | If you want to trigger a new smooth scroll and cancel the previous one, update this object. |
Called when smooth scroll is started. This might be a good time to do setup.
Called when smooth scroller is stopped. This is a good place to cleanup your state etc.
Called when the target position is laid out. This is the last callback SmoothScroller
will receive and it should update the provided RecyclerView.SmoothScroller.Action
to define the scroll
details towards the target view.
targetView | The view element which render the target position. |
---|---|
state | Transient state of RecyclerView |
action | Action instance that you should update to define final scroll action towards the targetView |
RecyclerView.SmoothScroller.Action
to finalize the smooth scrolling
Stops running the SmoothScroller in each animation callback. Note that this does not
cancel any existing RecyclerView.SmoothScroller.Action
updated by
onTargetFound(android.view.View, RecyclerView.State, SmoothScroller.Action)
or
onSeekTargetStep(int, int, RecyclerView.State, SmoothScroller.Action)
.