RecyclerView回收复用以及LayoutManager

1.滑动
2.onlayout布局

1.mInChangeScrap-mAttachedScrap 用来缓存还在屏幕之内的ViewHolder
2.mCachedView 用来缓存移除屏幕之外的ViewHolder
3.mViewCacheExtension 开发给用户的自定义扩展缓存,需要用户自己管理View的创建和缓存
4.RecyclerViewPool ViewHolder缓存池

onTouchEvent-scrollByInternal-scrollStep-mLayout.scrollVerticallyBy-scrollBy-fill-layoutChunk-layoutState.next-addView(view)
layoutState.next-getViewForPosition(复用)-tryGetViewHolderForPositionByDeadline(返回ViewHolder)-
ViewHolder==ItemView
类型:
1.getChangedScrapViewForPosition(动画相关:by position,by id)-mChangedScrap.get(i)
false-2.getScrapOrHiddenOrCachedHolderForPosition(一级缓存)-mAttachedScrap.get(i)/mCachedViews.get(i)
false-3.getScrapOrCachedViewForId(ViewType,ItemId)-mAttachedScrap.get(i)/mCachedViews.get(i)
false-4.mViewCacheExtension.getViewForPositionAndType(自定义扩展缓存)
false-5.getRecycle

你可能感兴趣的:(Android)