Public 成员函数 | |
| void | setViewTypeCount (int viewTypeCount) |
| void | markChildrenDirty () |
| boolean | shouldRecycleViewType (int viewType) |
包函数 | |
| void | clear () |
| void | fillActiveViews (int childCount, int firstActivePosition) |
| View | getActiveView (int position) |
| View | getScrapView (int position) |
| void | addScrapView (View scrap) |
| void | scrapActiveViews () |
| void | reclaimScrapViews (List< View > views) |
| void | setCacheColorHint (int color) |
Private 成员函数 | |
| void | pruneScrapViews () |
Private 属性 | |
| RecyclerListener | mRecyclerListener |
| int | mFirstActivePosition |
| View[] | mActiveViews = new View[0] |
| ArrayList< View >[] | mScrapViews |
| int | mViewTypeCount |
| ArrayList< View > | mCurrentScrap |
The RecycleBin facilitates reuse of views across layouts. The RecycleBin has two levels of storage: ActiveViews and ScrapViews. ActiveViews are those views which were onscreen at the start of a layout. By construction, they are displaying current information. At the end of layout, all views in ActiveViews are demoted to ScrapViews. ScrapViews are old views that could potentially be used by the adapter to avoid allocating views unnecessarily.
|
inlinepackage |
Put a view into the ScapViews list. These views are unordered.
| scrap | The view to add |
|
inlinepackage |
Clears the scrap heap.
|
inlinepackage |
Fill ActiveViews with all of the children of the AbsListView.
| childCount | The minimum number of views mActiveViews should hold |
| firstActivePosition | The position of the first view that will be stored in mActiveViews |
|
inlinepackage |
Get the view corresponding to the specified position. The view will be removed from mActiveViews if it is found.
| position | The position to look up in mActiveViews |
|
inlinepackage |
|
inline |
|
inlineprivate |
Makes sure that the size of mScrapViews does not exceed the size of mActiveViews. (This can happen if an adapter does not recycle its views).
|
inlinepackage |
Puts all views in the scrap heap into the supplied list.
|
inlinepackage |
Move all views remaining in mActiveViews to mScrapViews.
|
inlinepackage |
Updates the cache color hint of all known views.
| color | The new cache color hint. |
|
inline |
|
inline |
|
private |
Views that were on screen at the start of layout. This array is populated at the start of layout, and at the end of layout all view in mActiveViews are moved to mScrapViews. Views in mActiveViews represent a contiguous range of Views, with position of the first view store in mFirstActivePosition.
|
private |
|
private |
The position of the first view stored in mActiveViews.
|
private |
|
private |
Unsorted views that can be used by the adapter as a convert view.
|
private |
1.8.4