RecyclerView.SmoothScroller.Action
public
static
class
RecyclerView.SmoothScroller.Action
extends Object
Holds information about a smooth scroll request by a RecyclerView.SmoothScroller
.
Summary
Inherited methods |
From
class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait(long millis, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long millis)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
|
Constants
UNDEFINED_DURATION
int UNDEFINED_DURATION
Constant Value:
-2147483648
(0x80000000)
Public constructors
RecyclerView.SmoothScroller.Action
RecyclerView.SmoothScroller.Action (int dx,
int dy)
Parameters |
dx |
int :
Pixels to scroll horizontally |
dy |
int :
Pixels to scroll vertically
|
RecyclerView.SmoothScroller.Action
RecyclerView.SmoothScroller.Action (int dx,
int dy,
int duration)
Parameters |
dx |
int :
Pixels to scroll horizontally |
dy |
int :
Pixels to scroll vertically |
duration |
int :
Duration of the animation in milliseconds
|
RecyclerView.SmoothScroller.Action
RecyclerView.SmoothScroller.Action (int dx,
int dy,
int duration,
Interpolator interpolator)
Parameters |
dx |
int :
Pixels to scroll horizontally |
dy |
int :
Pixels to scroll vertically |
duration |
int :
Duration of the animation in milliseconds |
interpolator |
Interpolator :
Interpolator to be used when calculating scroll position in each
animation step
|
Public methods
getDuration
int getDuration ()
jumpTo
void jumpTo (int targetPosition)
Instead of specifying pixels to scroll, use the target position to jump using
scrollToPosition(int)
.
You may prefer using this method if scroll target is really far away and you prefer
to jump to a location and smooth scroll afterwards.
Note that calling this method takes priority over other update methods such as
update(int, int, int, Interpolator)
, setX(float)
,
setY(float)
and #setInterpolator(Interpolator)
. If you call
jumpTo(int)
, the other changes will not be considered for this animation
frame.
Parameters |
targetPosition |
int :
The target item position to scroll to using instant scrolling.
|
setDuration
void setDuration (int duration)
setDx
void setDx (int dx)
setDy
void setDy (int dy)
setInterpolator
void setInterpolator (Interpolator interpolator)
Sets the interpolator to calculate scroll steps
Parameters |
interpolator |
Interpolator :
The interpolator to use. If you specify an interpolator, you must
also set the duration. |
update
void update (int dx,
int dy,
int duration,
Interpolator interpolator)
Updates the action with given parameters.
Parameters |
dx |
int :
Pixels to scroll horizontally |
dy |
int :
Pixels to scroll vertically |
duration |
int :
Duration of the animation in milliseconds |
interpolator |
Interpolator :
Interpolator to be used when calculating scroll position in each
animation step
|