belongs to Maven artifact com.android.support:recyclerview-v7:28.0.0-alpha1
RecyclerView.SmoothScroller.Action
public
static
class
RecyclerView.SmoothScroller.Action
extends Object
| java.lang.Object | |
| ↳ | android.support.v7.widget.RecyclerView.SmoothScroller.Action |
Holds information about a smooth scroll request by a RecyclerView.SmoothScroller.
Summary
Constants | |
|---|---|
int |
UNDEFINED_DURATION
|
Public constructors | |
|---|---|
RecyclerView.SmoothScroller.Action(int dx, int dy)
|
|
RecyclerView.SmoothScroller.Action(int dx, int dy, int duration)
|
|
RecyclerView.SmoothScroller.Action(int dx, int dy, int duration, Interpolator interpolator)
|
|
Public methods | |
|---|---|
int
|
getDuration()
|
int
|
getDx()
|
int
|
getDy()
|
Interpolator
|
getInterpolator()
|
void
|
jumpTo(int targetPosition)
Instead of specifying pixels to scroll, use the target position to jump using
|
void
|
setDuration(int duration)
|
void
|
setDx(int dx)
|
void
|
setDy(int dy)
|
void
|
setInterpolator(Interpolator interpolator)
Sets the interpolator to calculate scroll steps |
void
|
update(int dx, int dy, int duration, Interpolator interpolator)
Updates the action with given parameters. |
Inherited methods | |
|---|---|
java.lang.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
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.
|
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. |
See also:
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
|
Annotations
Interfaces
- ActionMenuView.OnMenuItemClickListener
- PopupMenu.OnDismissListener
- PopupMenu.OnMenuItemClickListener
- RecyclerView.ChildDrawingOrderCallback
- RecyclerView.ItemAnimator.ItemAnimatorFinishedListener
- RecyclerView.LayoutManager.LayoutPrefetchRegistry
- RecyclerView.OnChildAttachStateChangeListener
- RecyclerView.OnItemTouchListener
- RecyclerView.RecyclerListener
- RecyclerView.SmoothScroller.ScrollVectorProvider
- SearchView.OnCloseListener
- SearchView.OnQueryTextListener
- SearchView.OnSuggestionListener
- ShareActionProvider.OnShareTargetSelectedListener
- ThemedSpinnerAdapter
- Toolbar.OnMenuItemClickListener
Classes
- ActionMenuView
- ActionMenuView.LayoutParams
- AppCompatAutoCompleteTextView
- AppCompatButton
- AppCompatCheckBox
- AppCompatCheckedTextView
- AppCompatEditText
- AppCompatImageButton
- AppCompatImageView
- AppCompatMultiAutoCompleteTextView
- AppCompatRadioButton
- AppCompatRatingBar
- AppCompatSeekBar
- AppCompatSpinner
- AppCompatTextView
- CardView
- DefaultItemAnimator
- DividerItemDecoration
- GridLayout
- GridLayout.Alignment
- GridLayout.LayoutParams
- GridLayout.Spec
- GridLayoutManager
- GridLayoutManager.DefaultSpanSizeLookup
- GridLayoutManager.LayoutParams
- GridLayoutManager.SpanSizeLookup
- LinearLayoutCompat
- LinearLayoutCompat.LayoutParams
- LinearLayoutManager
- LinearLayoutManager.LayoutChunkResult
- LinearSmoothScroller
- LinearSnapHelper
- ListPopupWindow
- OrientationHelper
- PagerSnapHelper
- PopupMenu
- RecyclerView
- RecyclerView.Adapter
- RecyclerView.AdapterDataObserver
- RecyclerView.EdgeEffectFactory
- RecyclerView.ItemAnimator
- RecyclerView.ItemAnimator.ItemHolderInfo
- RecyclerView.ItemDecoration
- RecyclerView.LayoutManager
- RecyclerView.LayoutManager.Properties
- RecyclerView.LayoutParams
- RecyclerView.OnFlingListener
- RecyclerView.OnScrollListener
- RecyclerView.RecycledViewPool
- RecyclerView.Recycler
- RecyclerView.SimpleOnItemTouchListener
- RecyclerView.SmoothScroller
- RecyclerView.SmoothScroller.Action
- RecyclerView.State
- RecyclerView.ViewCacheExtension
- RecyclerView.ViewHolder
- RecyclerViewAccessibilityDelegate
- RecyclerViewAccessibilityDelegate.ItemDelegate
- SearchView
- ShareActionProvider
- SimpleItemAnimator
- SnapHelper
- StaggeredGridLayoutManager
- StaggeredGridLayoutManager.LayoutParams
- SwitchCompat
- ThemedSpinnerAdapter.Helper
- Toolbar
- Toolbar.LayoutParams
- Toolbar.SavedState
- TooltipCompat