@ Override public int getItemViewType ( int position ) { Pair < AdapterDataObserver , Adapter > p = findAdapterByPosition ( position ) ; if ( p == null ) { return RecyclerView . INVALID_TYPE ; } int subItemType = p . second . getItemViewType ( position - p . first . mStartPosition ) ; if ( subItemType < 0 ) { // negative integer, invalid, just return return subItemType ; } if ( mHasConsistItemType ) { mItemTypeAry . put ( subItemType , p . second ) ; return subItemType ; } int index = p . first . mIndex ; return ( int ) Cantor . getCantor ( subItemType , index ) ; }
Big integer of itemType returned by delegated adapter may lead to failed