belongs to Maven artifact com.android.support:recyclerview-v7:28.0.0-alpha1
RecyclerView.RecycledViewPool
public
static
class
RecyclerView.RecycledViewPool
extends Object
java.lang.Object | |
↳ | android.support.v7.widget.RecyclerView.RecycledViewPool |
RecycledViewPool lets you share Views between multiple RecyclerViews.
If you want to recycle views across RecyclerViews, create an instance of RecycledViewPool
and use setRecycledViewPool(RecycledViewPool)
.
RecyclerView automatically creates a pool for itself if you don't provide one.
Summary
Public constructors | |
---|---|
RecyclerView.RecycledViewPool()
|
Public methods | |
---|---|
void
|
clear()
Discard all ViewHolders. |
RecyclerView.ViewHolder
|
getRecycledView(int viewType)
Acquire a ViewHolder of the specified type from the pool, or |
int
|
getRecycledViewCount(int viewType)
Returns the current number of Views held by the RecycledViewPool of the given view type. |
void
|
putRecycledView(RecyclerView.ViewHolder scrap)
Add a scrap ViewHolder to the pool. |
void
|
setMaxRecycledViews(int viewType, int max)
Sets the maximum number of ViewHolders to hold in the pool before discarding. |
Inherited methods | |
---|---|
From
class
java.lang.Object
|
Public constructors
Public methods
getRecycledView
RecyclerView.ViewHolder getRecycledView (int viewType)
Acquire a ViewHolder of the specified type from the pool, or null
if none are
present.
Parameters | |
---|---|
viewType |
int : ViewHolder type. |
Returns | |
---|---|
RecyclerView.ViewHolder |
ViewHolder of the specified type acquired from the pool, or null if none
are present.
|
getRecycledViewCount
int getRecycledViewCount (int viewType)
Returns the current number of Views held by the RecycledViewPool of the given view type.
Parameters | |
---|---|
viewType |
int |
Returns | |
---|---|
int |
putRecycledView
void putRecycledView (RecyclerView.ViewHolder scrap)
Add a scrap ViewHolder to the pool.
If the pool is already full for that ViewHolder's type, it will be immediately discarded.
Parameters | |
---|---|
scrap |
RecyclerView.ViewHolder : ViewHolder to be added to the pool.
|
setMaxRecycledViews
void setMaxRecycledViews (int viewType, int max)
Sets the maximum number of ViewHolders to hold in the pool before discarding.
Parameters | |
---|---|
viewType |
int : ViewHolder Type |
max |
int : Maximum number
|
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