AndBase开发框架  1.5.7
 全部  命名空间 文件 函数 变量 枚举值 
Public 成员函数 | 包函数 | Private 成员函数 | Private 属性 | 所有成员列表
com.ab.view.pullview.AbMultiColumnBaseAbsListView.RecycleBin类 参考

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.

参见
android.widget.AbsListView::setRecyclerListener(android.widget.AbsListView.RecyclerListener)
android.widget.AbsListView.RecyclerListener

成员函数说明

void com.ab.view.pullview.AbMultiColumnBaseAbsListView.RecycleBin.addScrapView ( View  scrap)
inlinepackage

Put a view into the ScapViews list. These views are unordered.

参数
scrapThe view to add
void com.ab.view.pullview.AbMultiColumnBaseAbsListView.RecycleBin.clear ( )
inlinepackage

Clears the scrap heap.

void com.ab.view.pullview.AbMultiColumnBaseAbsListView.RecycleBin.fillActiveViews ( int  childCount,
int  firstActivePosition 
)
inlinepackage

Fill ActiveViews with all of the children of the AbsListView.

参数
childCountThe minimum number of views mActiveViews should hold
firstActivePositionThe position of the first view that will be stored in mActiveViews
View com.ab.view.pullview.AbMultiColumnBaseAbsListView.RecycleBin.getActiveView ( int  position)
inlinepackage

Get the view corresponding to the specified position. The view will be removed from mActiveViews if it is found.

参数
positionThe position to look up in mActiveViews
返回
The view if it is found, null otherwise
View com.ab.view.pullview.AbMultiColumnBaseAbsListView.RecycleBin.getScrapView ( int  position)
inlinepackage
返回
A view from the ScrapViews collection. These are unordered.
void com.ab.view.pullview.AbMultiColumnBaseAbsListView.RecycleBin.markChildrenDirty ( )
inline
void com.ab.view.pullview.AbMultiColumnBaseAbsListView.RecycleBin.pruneScrapViews ( )
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).

void com.ab.view.pullview.AbMultiColumnBaseAbsListView.RecycleBin.reclaimScrapViews ( List< View >  views)
inlinepackage

Puts all views in the scrap heap into the supplied list.

void com.ab.view.pullview.AbMultiColumnBaseAbsListView.RecycleBin.scrapActiveViews ( )
inlinepackage

Move all views remaining in mActiveViews to mScrapViews.

void com.ab.view.pullview.AbMultiColumnBaseAbsListView.RecycleBin.setCacheColorHint ( int  color)
inlinepackage

Updates the cache color hint of all known views.

参数
colorThe new cache color hint.
void com.ab.view.pullview.AbMultiColumnBaseAbsListView.RecycleBin.setViewTypeCount ( int  viewTypeCount)
inline
boolean com.ab.view.pullview.AbMultiColumnBaseAbsListView.RecycleBin.shouldRecycleViewType ( int  viewType)
inline

类成员变量说明

View [] com.ab.view.pullview.AbMultiColumnBaseAbsListView.RecycleBin.mActiveViews = new View[0]
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.

ArrayList<View> com.ab.view.pullview.AbMultiColumnBaseAbsListView.RecycleBin.mCurrentScrap
private
int com.ab.view.pullview.AbMultiColumnBaseAbsListView.RecycleBin.mFirstActivePosition
private

The position of the first view stored in mActiveViews.

RecyclerListener com.ab.view.pullview.AbMultiColumnBaseAbsListView.RecycleBin.mRecyclerListener
private
ArrayList<View> [] com.ab.view.pullview.AbMultiColumnBaseAbsListView.RecycleBin.mScrapViews
private

Unsorted views that can be used by the adapter as a convert view.

int com.ab.view.pullview.AbMultiColumnBaseAbsListView.RecycleBin.mViewTypeCount
private

该类的文档由以下文件生成: