android.widget
protected
class
android.widget.AbsListView.RecycleBin
The RecycleBin facilitates resuse 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.
Summary
Protected Constructors
Protected Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Protected Constructors
protected
AbsListView.RecycleBin()
Protected Methods
protected
void
addScrapView(View scrap)
Put a view into the ScapViews list. These views are unordered.
protected
void
fillActiveViews(int childCount, int firstActivePosition)
Fill ActiveViews with all of the children of the AbsListView. This is equivalent to
calling
prepareActiveViews(int, int) followed by calls to
putActiveView(int, View).
Parameters
| childCount
| The minimum number of views mActiveViews should hold |
| firstActivePosition
| The position of the first view that will be stored in
mActiveViews
|
protected
View
getActiveView(int position)
Get the view corresponding to the specified position. The view will be removed from
mActiveViews if it is found.
Parameters
| position
| The position to look up in mActiveViews |
Returns
- The view if it is found, null otherwise
protected
View
getScrapView()
Returns
- A view from the ScrapViews collection. These are unordered.
protected
void
prepareActiveViews(int childCount, int firstActivePosition)
Call this to make sure that ActiveViews has enough storage for the views that it needs to
hold.
Parameters
| childCount
| The minimum number of views mActiveViews should hold |
| firstActivePosition
| The position of the first view that will be stored in
mActiveViews
|
protected
void
putActiveView(int position, View activeView)
Add a view to mActiveView
Parameters
| position
| The position of the view being added |
| activeView
| The view to add
|
protected
void
scrapActiveViews()
Move all views remaining in mActiveViews to mScrapViews.