@ SuppressWarnings ( "unused" ) public void selectItem ( int position , boolean invokeListeners ) { IOperationItem item = mOuterAdapter . getItem ( position ) ; IOperationItem oldHidedItem = mOuterAdapter . getItem ( mRealHidedPosition ) ; int realPosition = mOuterAdapter . normalizePosition ( position ) ; //do nothing if position not changed if ( realPosition == mCurrentItemPosition ) { return ; } int itemToShowAdapterPosition = position - realPosition + mRealHidedPosition ; item . setVisible ( false ) ; startSelectedViewOutAnimation ( position ) ; mOuterAdapter . notifyRealItemChanged ( position ) ; mRealHidedPosition = realPosition ; oldHidedItem . setVisible ( true ) ; mFlContainerSelected . requestLayout ( ) ; mOuterAdapter . notifyRealItemChanged ( itemToShowAdapterPosition ) ; mCurrentItemPosition = realPosition ; if ( invokeListeners ) { notifyItemClickListeners ( realPosition ) ; } if ( BuildConfig . DEBUG ) { Log . i ( TAG , "clicked on position =" + position ) ; } }
Select item by it s position