private void addAnimatingView ( View view ) { boolean alreadyAdded = false ; if ( mNumAnimatingViews > 0 ) { for ( int i = mAnimatingViewIndex ; i < getChildCount ( ) ; ++ i ) { if ( getChildAt ( i ) == view ) { alreadyAdded = true ; break ; } } } if ( ! alreadyAdded ) { if ( mNumAnimatingViews == 0 ) { mAnimatingViewIndex = getChildCount ( ) ; } ++ mNumAnimatingViews ; addView ( view ) ; } mRecycler . unscrapView ( getChildViewHolder ( view ) ) ; }
Adds a view to the animatingViews list . mAnimatingViews holds the child views that are currently being kept around purely for the purpose of being animated out of view . They are drawn as a regular part of the child list of the RecyclerView but they are invisible to the LayoutManager as they are managed separately from the regular child views .