Unit |
addFocusables(views: ArrayList<View!>!, direction: Int, focusableMode: Int)
|
Unit |
addItemDecoration(@NonNull decor: RecyclerView.ItemDecoration, index: Int)
Add an ItemDecoration to this RecyclerView. Item decorations can affect both measurement and drawing of individual item views.
Item decorations are ordered. Decorations placed earlier in the list will be run/queried/drawn first for their effects on item views. Padding added to views will be nested; a padding added by an earlier decoration will mean further item decorations in the list will be asked to draw/pad within the previous decoration's given area.
|
Unit |
addItemDecoration(@NonNull decor: RecyclerView.ItemDecoration)
Add an ItemDecoration to this RecyclerView. Item decorations can affect both measurement and drawing of individual item views.
Item decorations are ordered. Decorations placed earlier in the list will be run/queried/drawn first for their effects on item views. Padding added to views will be nested; a padding added by an earlier decoration will mean further item decorations in the list will be asked to draw/pad within the previous decoration's given area.
|
Unit |
addOnChildAttachStateChangeListener(@NonNull listener: RecyclerView.OnChildAttachStateChangeListener)
Register a listener that will be notified whenever a child view is attached to or detached from RecyclerView.
This listener will be called when a LayoutManager or the RecyclerView decides that a child view is no longer needed. If an application associates expensive or heavyweight data with item views, this may be a good place to release or free those resources.
|
Unit |
addOnItemTouchListener(@NonNull listener: RecyclerView.OnItemTouchListener)
Add an OnItemTouchListener to intercept touch events before they are dispatched to child views or this view's standard scrolling behavior.
Client code may use listeners to implement item manipulation behavior. Once a listener returns true from OnItemTouchListener#onInterceptTouchEvent(RecyclerView, MotionEvent) its OnItemTouchListener#onTouchEvent(RecyclerView, MotionEvent) method will be called for each incoming MotionEvent until the end of the gesture.
|
Unit |
addOnScrollListener(@NonNull listener: RecyclerView.OnScrollListener)
Add a listener that will be notified of any changes in scroll state or position.
Components that add a listener should take care to remove it when finished. Other components that take ownership of a view may call clearOnScrollListeners() to remove all attached listeners.
|
Boolean |
checkLayoutParams(p: LayoutParams!)
|
Unit |
clearOnChildAttachStateChangeListeners()
Removes all listeners that were added via addOnChildAttachStateChangeListener(OnChildAttachStateChangeListener) .
|
Unit |
clearOnScrollListeners()
Remove all secondary listener that were notified of any changes in scroll state or position.
|
Int |
computeHorizontalScrollExtent()
Compute the horizontal extent of the horizontal scrollbar's thumb within the horizontal range. This value is used to compute the length of the thumb within the scrollbar's track.
The range is expressed in arbitrary units that must be the same as the units used by computeHorizontalScrollRange() and computeHorizontalScrollOffset() .
Default implementation returns 0.
If you want to support scroll bars, override RecyclerView.LayoutManager#computeHorizontalScrollExtent(RecyclerView.State) in your LayoutManager.
|
Int |
computeHorizontalScrollOffset()
Compute the horizontal offset of the horizontal scrollbar's thumb within the horizontal range. This value is used to compute the length of the thumb within the scrollbar's track.
The range is expressed in arbitrary units that must be the same as the units used by computeHorizontalScrollRange() and computeHorizontalScrollExtent() .
Default implementation returns 0.
If you want to support scroll bars, override RecyclerView.LayoutManager#computeHorizontalScrollOffset(RecyclerView.State) in your LayoutManager.
|
Int |
computeHorizontalScrollRange()
Compute the horizontal range that the horizontal scrollbar represents.
The range is expressed in arbitrary units that must be the same as the units used by computeHorizontalScrollExtent() and computeHorizontalScrollOffset() .
Default implementation returns 0.
If you want to support scroll bars, override RecyclerView.LayoutManager#computeHorizontalScrollRange(RecyclerView.State) in your LayoutManager.
|
Int |
computeVerticalScrollExtent()
Compute the vertical extent of the vertical scrollbar's thumb within the vertical range. This value is used to compute the length of the thumb within the scrollbar's track.
The range is expressed in arbitrary units that must be the same as the units used by computeVerticalScrollRange() and computeVerticalScrollOffset() .
Default implementation returns 0.
If you want to support scroll bars, override RecyclerView.LayoutManager#computeVerticalScrollExtent(RecyclerView.State) in your LayoutManager.
|
Int |
computeVerticalScrollOffset()
Compute the vertical offset of the vertical scrollbar's thumb within the vertical range. This value is used to compute the length of the thumb within the scrollbar's track.
The range is expressed in arbitrary units that must be the same as the units used by computeVerticalScrollRange() and computeVerticalScrollExtent() .
Default implementation returns 0.
If you want to support scroll bars, override RecyclerView.LayoutManager#computeVerticalScrollOffset(RecyclerView.State) in your LayoutManager.
|
Int |
computeVerticalScrollRange()
Compute the vertical range that the vertical scrollbar represents.
The range is expressed in arbitrary units that must be the same as the units used by computeVerticalScrollExtent() and computeVerticalScrollOffset() .
Default implementation returns 0.
If you want to support scroll bars, override RecyclerView.LayoutManager#computeVerticalScrollRange(RecyclerView.State) in your LayoutManager.
|
Boolean |
dispatchNestedFling(velocityX: Float, velocityY: Float, consumed: Boolean)
|
Boolean |
dispatchNestedPreFling(velocityX: Float, velocityY: Float)
|
Boolean |
dispatchNestedPreScroll(dx: Int, dy: Int, consumed: IntArray?, offsetInWindow: IntArray?)
|
Boolean |
dispatchNestedPreScroll(dx: Int, dy: Int, consumed: IntArray?, offsetInWindow: IntArray?, type: Int)
|
Boolean |
dispatchNestedScroll(dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int, offsetInWindow: IntArray?)
|
Boolean |
dispatchNestedScroll(dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int, offsetInWindow: IntArray?, type: Int)
|
Unit |
dispatchNestedScroll(dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int, offsetInWindow: IntArray?, type: Int, @NonNull consumed: IntArray)
|
Boolean |
dispatchPopulateAccessibilityEvent(event: AccessibilityEvent!)
|
Unit |
dispatchRestoreInstanceState(container: SparseArray<Parcelable!>!)
Override to prevent thawing of any views created by the adapter.
|
Unit |
dispatchSaveInstanceState(container: SparseArray<Parcelable!>!)
Override to prevent freezing of any views created by the adapter.
|
Unit |
draw(c: Canvas!)
|
Boolean |
drawChild(canvas: Canvas!, child: View!, drawingTime: Long)
|
View? |
findChildViewUnder(x: Float, y: Float)
Find the topmost view under the given point.
|
View? |
findContainingItemView(@NonNull view: View)
Traverses the ancestors of the given view and returns the item view that contains it and also a direct child of the RecyclerView. This returned view can be used to get the ViewHolder by calling getChildViewHolder(View) .
|
RecyclerView.ViewHolder? |
findContainingViewHolder(@NonNull view: View)
Returns the ViewHolder that contains the given view.
|
RecyclerView.ViewHolder? |
findViewHolderForAdapterPosition(position: Int)
Return the ViewHolder for the item in the given position of the data set. Unlike findViewHolderForLayoutPosition(int) this method takes into account any pending adapter changes that may not be reflected to the layout yet. On the other hand, if Adapter#notifyDataSetChanged() has been called but the new layout has not been calculated yet, this method will return null since the new positions of views are unknown until the layout is calculated.
This method checks only the children of RecyclerView. If the item at the given position is not laid out, it will not create a new one.
When the ItemAnimator is running a change animation, there might be 2 ViewHolders representing the same Item. In this case, the updated ViewHolder will be returned.
|
RecyclerView.ViewHolder! |
findViewHolderForItemId(id: Long)
Return the ViewHolder for the item with the given id. The RecyclerView must use an Adapter with stableIds to return a non-null value.
This method checks only the children of RecyclerView. If the item with the given id is not laid out, it will not create a new one. When the ItemAnimator is running a change animation, there might be 2 ViewHolders with the same id. In this case, the updated ViewHolder will be returned.
|
RecyclerView.ViewHolder? |
findViewHolderForLayoutPosition(position: Int)
Return the ViewHolder for the item in the given position of the data set as of the latest layout pass.
This method checks only the children of RecyclerView. If the item at the given position is not laid out, it will not create a new one.
Note that when Adapter contents change, ViewHolder positions are not updated until the next layout calculation. If there are pending adapter updates, the return value of this method may not match your adapter contents. You can use #ViewHolder#getAdapterPosition() to get the current adapter position of a ViewHolder.
When the ItemAnimator is running a change animation, there might be 2 ViewHolders with the same layout position representing the same Item. In this case, the updated ViewHolder will be returned.
|
RecyclerView.ViewHolder? |
findViewHolderForPosition(position: Int)
|
Boolean |
fling(velocityX: Int, velocityY: Int)
Begin a standard fling with an initial velocity along each axis in pixels per second. If the velocity given is below the system-defined minimum this method will return false and no fling will occur.
|
View! |
focusSearch(focused: View!, direction: Int)
Since RecyclerView is a collection ViewGroup that includes virtual children (items that are in the Adapter but not visible in the UI), it employs a more involved focus search strategy that differs from other ViewGroups.
It first does a focus search within the RecyclerView. If this search finds a View that is in the focus direction with respect to the currently focused View, RecyclerView returns that child as the next focus target. When it cannot find such child, it calls LayoutManager#onFocusSearchFailed(View, int, Recycler, State) to layout more Views in the focus search direction. If LayoutManager adds a View that matches the focus search criteria, it will be returned as the focus search result. Otherwise, RecyclerView will call parent to handle the focus search like a regular ViewGroup.
When the direction is View#FOCUS_FORWARD or View#FOCUS_BACKWARD , a View that is not in the focus direction is still valid focus target which may not be the desired behavior if the Adapter has more children in the focus direction. To handle this case, RecyclerView converts the focus direction to an absolute direction and makes a preliminary focus search in that direction. If there are no Views to gain focus, it will call LayoutManager#onFocusSearchFailed(View, int, Recycler, State) before running a focus search with the original (relative) direction. This allows RecyclerView to provide better candidates to the focus search while still allowing the view system to take focus from the RecyclerView and give it to a more suitable child if such child exists.
|
LayoutParams! |
generateDefaultLayoutParams()
|
LayoutParams! |
generateLayoutParams(attrs: AttributeSet!)
|
LayoutParams! |
generateLayoutParams(p: LayoutParams!)
|
CharSequence! |
getAccessibilityClassName()
|
RecyclerView.Adapter<RecyclerView.ViewHolder!>? |
getAdapter()
Retrieves the previously set adapter or null if no adapter is set.
|
Int |
getBaseline()
Return the offset of the RecyclerView's text baseline from the its top boundary. If the LayoutManager of this RecyclerView does not support baseline alignment, this method returns -1.
|
Int |
getChildAdapterPosition(@NonNull child: View)
Return the adapter position that the given child view corresponds to.
|
Long |
getChildItemId(@NonNull child: View)
Return the stable item id that the given child view corresponds to.
|
Int |
getChildLayoutPosition(@NonNull child: View)
Return the adapter position of the given child view as of the latest completed layout pass.
This position may not be equal to Item's adapter position if there are pending changes in the adapter which have not been reflected to the layout yet.
|
Int |
getChildPosition(@NonNull child: View)
|
RecyclerView.ViewHolder! |
getChildViewHolder(@NonNull child: View)
Retrieve the ViewHolder for the given child view.
|
Boolean |
getClipToPadding()
Returns whether this RecyclerView will clip its children to its padding, and resize (but not clip) any EdgeEffect to the padded region, if padding is present.
By default, children are clipped to the padding of their parent RecyclerView. This clipping behavior is only enabled if padding is non-zero.
|
RecyclerViewAccessibilityDelegate? |
getCompatAccessibilityDelegate()
Returns the accessibility delegate compatibility implementation used by the RecyclerView.
|
Unit |
getDecoratedBoundsWithMargins(@NonNull view: View, @NonNull outBounds: Rect)
Returns the bounds of the view including its decoration and margins.
|
RecyclerView.EdgeEffectFactory |
getEdgeEffectFactory()
Retrieves the previously set EdgeEffectFactory or the default factory if nothing was set.
|
RecyclerView.ItemAnimator? |
getItemAnimator()
Gets the current ItemAnimator for this RecyclerView. A null return value indicates that there is no animator and that item changes will happen without any animations. By default, RecyclerView instantiates and uses an instance of DefaultItemAnimator .
|
RecyclerView.ItemDecoration |
getItemDecorationAt(index: Int)
Returns an ItemDecoration previously added to this RecyclerView.
|
Int |
getItemDecorationCount()
Returns the number of ItemDecoration currently added to this RecyclerView.
|
RecyclerView.LayoutManager? |
getLayoutManager()
Return the LayoutManager currently responsible for layout policy for this RecyclerView.
|
Int |
getMaxFlingVelocity()
Returns the maximum fling velocity used by this RecyclerView.
|
Int |
getMinFlingVelocity()
Returns the minimum velocity to start a fling.
|
RecyclerView.OnFlingListener? |
getOnFlingListener()
Get the current OnFlingListener from this RecyclerView .
|
Boolean |
getPreserveFocusAfterLayout()
Returns true if the RecyclerView should attempt to preserve currently focused Adapter Item's focus even if the View representing the Item is replaced during a layout calculation.
By default, this value is true .
|
RecyclerView.RecycledViewPool |
getRecycledViewPool()
Retrieve this RecyclerView's RecycledViewPool . This method will never return null; if no pool is set for this view a new one will be created. See setRecycledViewPool for more information.
|
Int |
getScrollState()
Return the current scrolling state of the RecyclerView.
|
Boolean |
hasFixedSize()
|
Boolean |
hasNestedScrollingParent()
|
Boolean |
hasNestedScrollingParent(type: Int)
|
Boolean |
hasPendingAdapterUpdates()
Returns whether there are pending adapter updates which are not yet applied to the layout.
If this method returns true , it means that what user is currently seeing may not reflect them adapter contents (depending on what has changed). You may use this information to defer or cancel some operations.
This method returns true if RecyclerView has not yet calculated the first layout after it is attached to the Window or the Adapter has been replaced.
|
Unit |
invalidateItemDecorations()
Invalidates all ItemDecorations. If RecyclerView has item decorations, calling this method will trigger a requestLayout() call.
|
Boolean |
isAnimating()
Returns true if RecyclerView is currently running some animations.
If you want to be notified when animations are finished, use ItemAnimator#isRunning(ItemAnimator.ItemAnimatorFinishedListener) .
|
Boolean |
isAttachedToWindow()
Returns true if RecyclerView is attached to window.
|
Boolean |
isComputingLayout()
Returns whether RecyclerView is currently computing a layout.
If this method returns true, it means that RecyclerView is in a lockdown state and any attempt to update adapter contents will result in an exception because adapter contents cannot be changed while RecyclerView is trying to compute the layout.
It is very unlikely that your code will be running during this state as it is called by the framework when a layout traversal happens or RecyclerView starts to scroll in response to system events (touch, accessibility etc).
This case may happen if you have some custom logic to change adapter contents in response to a View callback (e.g. focus change callback) which might be triggered during a layout calculation. In these cases, you should just postpone the change using a Handler or a similar mechanism.
|
Boolean |
isLayoutFrozen()
|
Boolean |
isLayoutSuppressed()
Returns whether layout and scroll calls on this container are currently being suppressed, due to an earlier call to suppressLayout(boolean) .
|
Boolean |
isNestedScrollingEnabled()
|
Unit |
offsetChildrenHorizontal(@Px dx: Int)
Offset the bounds of all child views by dx pixels. Useful for implementing simple scrolling in LayoutManagers .
|
Unit |
offsetChildrenVertical(@Px dy: Int)
Offset the bounds of all child views by dy pixels. Useful for implementing simple scrolling in LayoutManagers .
|
Unit |
onAttachedToWindow()
|
Unit |
onChildAttachedToWindow(@NonNull child: View)
Called when an item view is attached to this RecyclerView.
Subclasses of RecyclerView may want to perform extra bookkeeping or modifications of child views as they become attached. This will be called before a LayoutManager measures or lays out the view and is a good time to perform these changes.
|
Unit |
onChildDetachedFromWindow(@NonNull child: View)
Called when an item view is detached from this RecyclerView.
Subclasses of RecyclerView may want to perform extra bookkeeping or modifications of child views as they become detached. This will be called as a LayoutManager fully detaches the child view from the parent and its window.
|
Unit |
onDetachedFromWindow()
|
Unit |
onDraw(c: Canvas!)
|
Boolean |
onGenericMotionEvent(event: MotionEvent!)
|
Boolean |
onInterceptTouchEvent(e: MotionEvent!)
|
Unit |
onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int)
|
Unit |
onMeasure(widthSpec: Int, heightSpec: Int)
|
Unit |
onRestoreInstanceState(state: Parcelable!)
|
Parcelable! |
onSaveInstanceState()
|
Unit |
onScrollStateChanged(state: Int)
Called when the scroll state of this RecyclerView changes. Subclasses should use this method to respond to state changes instead of an explicit listener.
This method will always be invoked before listeners, but after the LayoutManager responds to the scroll state change.
|
Unit |
onScrolled(@Px dx: Int, @Px dy: Int)
Called when the scroll position of this RecyclerView changes. Subclasses should use this method to respond to scrolling within the adapter's data set instead of an explicit listener.
This method will always be invoked before listeners. If a subclass needs to perform any additional upkeep or bookkeeping after scrolling but before listeners run, this is a good place to do so.
This differs from View#onScrollChanged(int, int, int, int) in that it receives the distance scrolled in either direction within the adapter's data set instead of absolute scroll coordinates. Since RecyclerView cannot compute the absolute scroll position from any arbitrary point in the data set, onScrollChanged will always receive the current View#getScrollX() and View#getScrollY() values which do not correspond to the data set scroll position. However, some subclasses may choose to use these fields as special offsets.
|
Unit |
onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int)
|
Boolean |
onTouchEvent(e: MotionEvent!)
|
Unit |
removeDetachedView(child: View!, animate: Boolean)
|
Unit |
removeItemDecoration(@NonNull decor: RecyclerView.ItemDecoration)
Remove an ItemDecoration from this RecyclerView.
The given decoration will no longer impact the measurement and drawing of item views.
|
Unit |
removeItemDecorationAt(index: Int)
Removes the ItemDecoration associated with the supplied index position.
|
Unit |
removeOnChildAttachStateChangeListener(@NonNull listener: RecyclerView.OnChildAttachStateChangeListener)
Removes the provided listener from child attached state listeners list.
|
Unit |
removeOnItemTouchListener(@NonNull listener: RecyclerView.OnItemTouchListener)
Remove an OnItemTouchListener . It will no longer be able to intercept touch events.
|
Unit |
removeOnScrollListener(@NonNull listener: RecyclerView.OnScrollListener)
Remove a listener that was notified of any changes in scroll state or position.
|
Unit |
requestChildFocus(child: View!, focused: View!)
|
Boolean |
requestChildRectangleOnScreen(child: View!, rect: Rect!, immediate: Boolean)
|
Unit |
requestDisallowInterceptTouchEvent(disallowIntercept: Boolean)
|
Unit |
requestLayout()
|
Unit |
scrollBy(x: Int, y: Int)
|
Unit |
scrollTo(x: Int, y: Int)
|
Unit |
sendAccessibilityEventUnchecked(event: AccessibilityEvent!)
|
Unit |
setAccessibilityDelegateCompat(@Nullable accessibilityDelegate: RecyclerViewAccessibilityDelegate?)
Sets the accessibility delegate compatibility implementation used by RecyclerView.
|
Unit |
setAdapter(@Nullable adapter: RecyclerView.Adapter<RecyclerView.ViewHolder!>?)
Set a new adapter to provide child views on demand.
When adapter is changed, all existing views are recycled back to the pool. If the pool has only one adapter, it will be cleared.
|
Unit |
setChildDrawingOrderCallback(@Nullable childDrawingOrderCallback: RecyclerView.ChildDrawingOrderCallback?)
Sets the ChildDrawingOrderCallback to be used for drawing children.
See ViewGroup#getChildDrawingOrder(int, int) for details. Calling this method will always call ViewGroup#setChildrenDrawingOrderEnabled(boolean) . The parameter will be true if childDrawingOrderCallback is not null, false otherwise.
Note that child drawing order may be overridden by View's elevation.
|
Unit |
setClipToPadding(clipToPadding: Boolean)
|
Unit |
setEdgeEffectFactory(@NonNull edgeEffectFactory: RecyclerView.EdgeEffectFactory)
Set a EdgeEffectFactory for this RecyclerView .
When a new EdgeEffectFactory is set, any existing over-scroll effects are cleared and new effects are created as needed using EdgeEffectFactory#createEdgeEffect(RecyclerView, int)
|
Unit |
setHasFixedSize(hasFixedSize: Boolean)
RecyclerView can perform several optimizations if it can know in advance that RecyclerView's size is not affected by the adapter contents. RecyclerView can still change its size based on other factors (e.g. its parent's size) but this size calculation cannot depend on the size of its children or contents of its adapter (except the number of items in the adapter).
If your use of RecyclerView falls into this category, set this to true . It will allow RecyclerView to avoid invalidating the whole layout when its adapter contents change.
|
Unit |
setItemAnimator(@Nullable animator: RecyclerView.ItemAnimator?)
Sets the ItemAnimator that will handle animations involving changes to the items in this RecyclerView. By default, RecyclerView instantiates and uses an instance of DefaultItemAnimator . Whether item animations are enabled for the RecyclerView depends on the ItemAnimator and whether the LayoutManager supports item animations .
|
Unit |
setItemViewCacheSize(size: Int)
Set the number of offscreen views to retain before adding them to the potentially shared recycled view pool .
The offscreen view cache stays aware of changes in the attached adapter, allowing a LayoutManager to reuse those views unmodified without needing to return to the adapter to rebind them.
|
Unit |
setLayoutFrozen(frozen: Boolean)
Enable or disable layout and scroll. After setLayoutFrozen(true) is called, Layout requests will be postponed until setLayoutFrozen(false) is called; child views are not updated when RecyclerView is frozen, smoothScrollBy(int, int) , scrollBy(int, int) , scrollToPosition(int) and smoothScrollToPosition(int) are dropped; TouchEvents and GenericMotionEvents are dropped; LayoutManager#onFocusSearchFailed(View, int, Recycler, State) will not be called.
setLayoutFrozen(true) does not prevent app from directly calling , LayoutManager#smoothScrollToPosition( * RecyclerView, State, int) .
setAdapter(Adapter) and swapAdapter(Adapter, boolean) will automatically stop frozen.
Note: Running ItemAnimator is not stopped automatically, it's caller's responsibility to call ItemAnimator.end().
|
Unit |
setLayoutManager(@Nullable layout: RecyclerView.LayoutManager?)
Set the LayoutManager that this RecyclerView will use.
In contrast to other adapter-backed views such as android.widget.ListView or android.widget.GridView , RecyclerView allows client code to provide custom layout arrangements for child views. These arrangements are controlled by the LayoutManager . A LayoutManager must be provided for RecyclerView to function.
Several default strategies are provided for common uses such as lists and grids.
|
Unit |
setLayoutTransition(transition: LayoutTransition!)
|
Unit |
setNestedScrollingEnabled(enabled: Boolean)
|
Unit |
setOnFlingListener(@Nullable onFlingListener: RecyclerView.OnFlingListener?)
Set a OnFlingListener for this RecyclerView .
If the OnFlingListener is set then it will receive calls to fling(int,int) and will be able to intercept them.
|
Unit |
setOnScrollListener(@Nullable listener: RecyclerView.OnScrollListener?)
Set a listener that will be notified of any changes in scroll state or position.
|
Unit |
setPreserveFocusAfterLayout(preserveFocusAfterLayout: Boolean)
Set whether the RecyclerView should try to keep the same Item focused after a layout calculation or not.
Usually, LayoutManagers keep focused views visible before and after layout but sometimes, views may lose focus during a layout calculation as their state changes or they are replaced with another view due to type change or animation. In these cases, RecyclerView can request focus on the new view automatically.
|
Unit |
setRecycledViewPool(@Nullable pool: RecyclerView.RecycledViewPool?)
Recycled view pools allow multiple RecyclerViews to share a common pool of scrap views. This can be useful if you have multiple RecyclerViews with adapters that use the same view types, for example if you have several data sets with the same kinds of item views displayed by a androidx.viewpager.widget.ViewPager .
|
Unit |
setScrollingTouchSlop(slopConstant: Int)
Configure the scrolling touch slop for a specific use case. Set up the RecyclerView's scrolling motion threshold based on common usages. Valid arguments are TOUCH_SLOP_DEFAULT and TOUCH_SLOP_PAGING .
|
Unit |
setViewCacheExtension(@Nullable extension: RecyclerView.ViewCacheExtension?)
Sets a new ViewCacheExtension to be used by the Recycler.
|
Unit |
smoothScrollBy(@Px dx: Int, @Px dy: Int)
Animate a scroll by the given amount of pixels along either axis.
|
Unit |
smoothScrollBy(@Px dx: Int, @Px dy: Int, @Nullable interpolator: Interpolator?)
Animate a scroll by the given amount of pixels along either axis.
|
Unit |
smoothScrollBy(@Px dx: Int, @Px dy: Int, @Nullable interpolator: Interpolator?, duration: Int)
Smooth scrolls the RecyclerView by a given distance.
|
Boolean |
startNestedScroll(axes: Int)
|
Boolean |
startNestedScroll(axes: Int, type: Int)
|
Unit |
stopNestedScroll()
|
Unit |
stopNestedScroll(type: Int)
|
Unit |
stopScroll()
Stop any current scroll in progress, such as one started by smoothScrollBy(int, int) , fling(int, int) or a touch-initiated fling.
|
Unit |
suppressLayout(suppress: Boolean)
Tells this RecyclerView to suppress all layout and scroll calls until layout suppression is disabled with a later call to suppressLayout(false). When layout suppression is disabled, a requestLayout() call is sent if requestLayout() was attempted while layout was being suppressed.
In addition to the layout suppression smoothScrollBy(int, int) , scrollBy(int, int) , scrollToPosition(int) and smoothScrollToPosition(int) are dropped; TouchEvents and GenericMotionEvents are dropped; LayoutManager#onFocusSearchFailed(View, int, Recycler, State) will not be called.
suppressLayout(true) does not prevent app from directly calling , LayoutManager#smoothScrollToPosition( * RecyclerView, State, int) .
setAdapter(Adapter) and swapAdapter(Adapter, boolean) will automatically stop suppressing.
Note: Running ItemAnimator is not stopped automatically, it's caller's responsibility to call ItemAnimator.end().
|
Unit |
swapAdapter(@Nullable adapter: RecyclerView.Adapter<RecyclerView.ViewHolder!>?, removeAndRecycleExistingViews: Boolean)
Swaps the current adapter with the provided one. It is similar to setAdapter(Adapter) but assumes existing adapter and the new adapter uses the same ViewHolder and does not clear the RecycledViewPool.
Note that it still calls onAdapterChanged callbacks.
|